flexmark-java
flexmark-java copied to clipboard
Skip nodes and stop traversing support for PostProcessor
Is your feature request related to a problem? Please describe. My task is to transform Markdown by extracting the first image and limited number of words. I have created custom PostProcessor to solve that. But I couldn't find a way to
- Skip the node. When I collect text from a Text node, image text is also captured, so I need a way to skip the image node. The current solution is to check text node's parent but that looks like a hack
- Stop processing the markdown. Once specific number of text collected I need to stop processing the AST.
Describe the solution you'd like Can we add some methods to NodeTracker so we can skip nodes and stop traversing?