flexmark-java icon indicating copy to clipboard operation
flexmark-java copied to clipboard

Skip nodes and stop traversing support for PostProcessor

Open SunPj opened this issue 3 years ago • 0 comments

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

  1. 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
  2. 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?

SunPj avatar Jun 01 '22 10:06 SunPj