mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-09 21:42:15 +00:00
Allow Inline to access its parent LeafBlock #393
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yufeih on GitHub (Aug 4, 2020).
In the
Block-->Inlinehierarchical design of markdig, it is easy to traverse the markdown object tree from top to bottom, but it doesn't seem possible to reverse lookup the path of any markdown object all the way up to the root node. (Correct me if I am wrong).For one, bugs like #460 leads to incorrect
Parentvalue, alsoInlinedoes not seem to have a way to trace back to the containingLeafBlock.The ask is to provide a contract to reliability trace back the path to root for any given
MarkdownObject, be itBlockorInline. The contract should work reliably after the markdown AST has been constructed. (InDocumentProcessedcallback and renderers), depending on how parsers are designed, it would be great to have it also work inside custom parsers.docfx have built a couple of markdig extensions to support file inclusion, markdown section versioning. Having the ability to reliably trace back to root makes it easy to answer questions like what file a markdown object belongs to, what version is a markdown object, etc.