Skip to content
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

Markdown renderer #57

Open
devnote-dev opened this issue Apr 9, 2023 · 2 comments
Open

Markdown renderer #57

devnote-dev opened this issue Apr 9, 2023 · 2 comments

Comments

@devnote-dev
Copy link
Contributor

devnote-dev commented Apr 9, 2023

A renderer for markdown (markdown -> markdown, instead of just markdown -> HTML). This would be useful if you just want to insert/edit/remove parts of a markdown document (e.g. setting a default language for fenced code blocks).

@straight-shoota
Copy link
Contributor

Just a note on that use case: Markdown syntax has quite a lot ambiguities and alternative styles to express the same thing. So the process parse -> mutate AST -> stringify can introduce syntactic changes besides the ones that you actually intent to do. Maybe this doesn't matter much for your use case, but it's an annoyance (at least) for many applications.
To avoid this you would need some way to convey information about syntax variations from the parser to the stringifier. Currently the AST is not capable of that.

@devnote-dev
Copy link
Contributor Author

I see what you mean, for my use-case I'm setting the default language for doc comments in Crystal to crystal but that might cause issues if someone uses a tilde-based code block instead of a back tick one. At the same time, I'm not sure if it's worth implementing support for the variants as that specific edge case is unlikely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants