Ionaru / Ionaru/easy-markdown-editor
Preprocessing step for markdown renderer
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 363
- PR merge metrics
- No merged PRs in 30d
Description
First off, thanks for continuing this great project.
I've been attempting to add some way to add metadata to my documents. First off, I understand fully that metadata is not supported by markdown, and that in all likelyhood it will never be supported by markdown itself. That being the case, there have been a few proposals to support it in the syntax, without breaking it. One specific proposal caught our attention: if lines start with "| ", we want to assume it's metadata.
Why in the editor... If we don't put the metadata itself in the editor, it will be hard to keep track of the character ranges. In all fairness, I would prefer to just leave it out of the editor... but once people start editing the document it will probably become a mess; after all, what is the behavior supposed to be if someone moves a piece of text from one place to the other?
So, what I would prefer to do is just have the editor as-is, and then add a preprocessing step to the text before it is rendered. Changing the grammar in CodeMirror will probably be the least of our trouble.
My question is: is there such a hook or possibility in the editor where we can replace the CodeMirror parser, capture the data from CodeMirror, then basically get rid of all the metadata and then throw it to the renderer?
Contributor guide
Assessment
This issue has not been assessed yet.