spotless icon indicating copy to clipboard operation
spotless copied to clipboard

Markdown formatter destroys Yaml Front matter metadata

Open kwin opened this issue 3 months ago • 1 comments

Often Markdown uses metadata in the format of YAML front matter. This is supported e.g. via https://github.com/vsch/flexmark-java/wiki/Extensions#yaml-front-matter. However the markdown formatter currently destroys/reformats the tailing triple-dashed-line ---.

kwin avatar Sep 12 '25 12:09 kwin

I played around a bit, and this would be easily solved by activating JekyllFrontMatterExtension or YamlFrontMatterExtension on flexmark. Don't ask me what the difference between those is.

Maybe this issue could rather be treated as a new feature: one should be able to configure the FlexmarkStep. Like setting the ParserEmulationProfile to something else than CommonMark, changing the pegdown compatibility flags and also activate custom extensions like the ones mentioned above.

Plunts avatar Oct 19 '25 10:10 Plunts