TreeRewriteStage
Pipeline stage that rewrites the AST after function call expansion to apply user-defined extensions to Markdown primitives.
Primitive nodes that implement com.quarkdown.core.ast.attributes.primitive.PrimitiveFunctionBackedNode (e.g. headings) are wrapped into a com.quarkdown.core.ast.quarkdown.FunctionCallNode whenever their backing function has been wrapped via .extend, then immediately expanded so the wrapper output replaces the original primitive. This is the mechanism that lets .extend {heading} affect both .heading {...} calls and plain # Markdown syntax.
As an optimization, the rewrite is skipped entirely when no extension is registered in the context, which is the common case.
See also
for the underlying traversal logic
Properties
Functions
Executes this pipeline stage with the given input and shared data.
Utility function to execute a pipeline stage that takes Unit as input.
Invokes the hook function for this stage, if one is defined.
Chains two pipeline stages together to form a new pipeline stage.
Conditionally chains this pipeline stage with next if it is not null.