Switch from the planned custom Flexmark opaque front matter extension to commonmark-java's built-in YamlFrontMatterExtension with RawContentParser.
Background
commonmark-java's YamlFrontMatterExtension supports a RawContentParser mode that captures the entire front matter block as a single raw string, enabling verbatim round-trip through MarkdownRenderer. This replaces the originally planned custom Flexmark BlockParser / NodeFormatter extension.
Scope
- Wire up
YamlFrontMatterExtension.create(RawContentParser.Factory()) in MarkdownParser - Verify that
YamlFrontMatterVisitor.readRawContent(document) returns the raw front matter string - Confirm round-trip: parse → render to Markdown → front matter is byte-for-byte identical
- Confirm documents without front matter are unaffected
Acceptance criteria
- A
MarkdownDocument with front matter round-trips through MarkdownRenderer with no mutation to the front matter block - Documents without front matter are unaffected
Switch from the planned custom Flexmark opaque front matter extension to commonmark-java's built-in
YamlFrontMatterExtensionwithRawContentParser.Background
commonmark-java's
YamlFrontMatterExtensionsupports aRawContentParsermode that captures the entire front matter block as a single raw string, enabling verbatim round-trip throughMarkdownRenderer. This replaces the originally planned custom FlexmarkBlockParser/NodeFormatterextension.Scope
YamlFrontMatterExtension.create(RawContentParser.Factory())inMarkdownParserYamlFrontMatterVisitor.readRawContent(document)returns the raw front matter stringAcceptance criteria
MarkdownDocumentwith front matter round-trips throughMarkdownRendererwith no mutation to the front matter block