Switching Markdown rendering from legacy parser to CommonMark: impact on nested lists and intra-word emphasis
0 reputation · 13 Apr 2022, 09:33 UTC
Goal: ensure that migrating the Markdown rendering pipeline of a small internal documentation site from a legacy parser (behaving like the original Markdown.pl) to a CommonMark‑compliant parser does not alter the generated HTML for existing content, allowing the change to be deployed without downtime.
Constraints: the migration must be validated against the full corpus of documents; any silent changes in output (e.g., nested list indentation, intra‑word underscores, setext heading handling) could break CSS selectors, anchor links, or embedded HTML assumptions. Parser‑specific options such as hard line breaks, raw HTML passthrough, and safety mode may differ between libraries and affect the result even when both claim CommonMark compliance.
Questions:
- Which parser configuration flags must be matched to preserve the current HTML output for lists, emphasis, and headings?
- How can we automatically detect rendering differences in nested lists, intra‑word emphasis, and raw HTML blocks before cutover?
- What rollback‑free strategy (e.g., dual‑rendering with feature flag) can be used to verify zero‑downtime migration if discrepancies are found?