markdown
markdown copied to clipboard
Parsing: add reference nodes to AST tree
Here is the problem: autoresolving of referenced links works well, however, for me, it's strictly important to get reference link definitions unchanged. E.g. this code:
Hello [world][wiki-world]
[wiki-world]: https://wikipedia.com/blah-blah-blah
can't be parsed and rendered back again to same structure, instead of this, ast with markdown renderer, renders to this structure:
Hello [world](https://wikipedia.com/blah-blah-blah)
which isn't what i expect from syntax tree.
I looked a bit in code, and found that for now, links parser has overcomplicated structure, imho, so maybe it's time to refactor it a bit? As far as i understand, the proposed change is impossible with current implementation of links parser.
I'm happy to accept patches but to set expectation: I'm not going to work on this myself.