-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Converting to Markdown #17
Comments
I'm glad that you would like to add this, as I wanted to do it but didn't have enough time! The general idea I had was to:
Regarding the inter-block, you cannot rely on the info (start, offset), because the syntax tree could be built by code without a parser. You basically need to have a few rendering options (per block type..etc. it will depend. Typically options like cutting paragraph to a certain width of characters...etc.) and a default behaviour for the spaces we should be CommonMark compliant depending on the block types, so that we can reparse the document and get exactly the same HTML rendering. So a PR for this would be much welcome! You can start by the core parsers, and progressively we could extend it to all supported extensions. Let me know if you are interested! |
Hi Alexandre, WDYT? At the moment I've already started writing a simple POC which subclasses TextRendererBase and reimplements core block and inline renderers, just to make some practice. |
I would prefer first to focus on a plain normalize that doesn't use the original source document but only the syntax tree. |
Can the normalizer take options that lets the caller specify indent size (2 spaces instead of 4 for instance)? |
Sure. |
@giacomocariello do you have a fork with already some code? as I would like to implement this feature asap for MarkdownEditor, otherwise I may start it directly in a new markdig branch, let me know! |
Closing this issue as it is now tracked by #155 |
I'm trying to develop an alternative renderer which should produce exactly the same content as the file input. I'm wondering what's the easiest way to represent inter-block whitespace. If every block kept slicing info (start, offset), it would be easier to derive whitespace info.
Could you give me some hint on what could be the best approach?
The text was updated successfully, but these errors were encountered: