-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to use parsed Markdown #123
Conversation
During the initial implementation of Markdown composable, we've had a similar discussion about exposing an alternative API where commonmark would be just another pluggable parser to a common Markdown Tree that we can define for ourselves. This way anyone could use their own Would you be willing to introduce something like that? I know it's a way larger project in scope compared to this solution. Although the module itself is named |
Can you please clarify what the API would look like. Do you mean passing a parser function directly into composable? Wouldn't that require commonmark dependency as well? Also passing a parser wouldn't solve some of the problems related to asynchronous calls in the UI code. One option I can think of is to make own data models that map to commonmark internally. That way we don't need to expose commonmark externally. Basically exposing |
@halilozercan any thoughts? I'm happy to modify the code, but need some clarification. |
@halilozercan are we able to move forward with something? Any guidance on what you want to see as the API? |
Very interesting point of view. I personally think having a custom parser is not that important, but it's because the solution as it is now fits my needs. |
@halilozercan Could you consider synchronized composition so we can use markdown in lazylists more efficiently ? |
I'm sorry for abandoning this issue and the discussion. Here is what I had in mind;
The only difficult element in this path is figuring out the API for
|
#129 adds a similar capability without exposing the commonmark dependency. |
Currently the library parses markdown internally, but there are several issues with it:
This PR adds an overload for
Markdown
composable that takes CommonmarkNode
object.One drawback is that we need to expose Commonmark as an API dependency because public API now uses it, but feel like it should be ok considering that the module is called
richtext-commonmark
.