Unmatched emphasis delimiter error when processing Markdown with internal line breaks
27.5K reputation · 10 Nov 2024, 04:49 UTC
The goal is to decide how a Markdown parser should handle emphasis markers that span a raw newline without an explicit hard‑break or escape, so that deployment logs consistently reflect either a warning or correct output.
Current CommonMark specifications permit line breaks inside emphasis only when the break is escaped or represented by a hard line break; many implementations diverge, either treating the newline as emphasis‑closing, ignoring it, or emitting an “Unmatched emphasis delimiter” warning. This inconsistency makes it difficult to predict whether a given document will produce italic text, plain text, or a log error across different parser versions or configurations.
What behavior should be adopted for raw newlines inside emphasis: should they close the emphasis and trigger an unmatched‑delimiter warning, should they be ignored while preserving emphasis, or should a configurable flag control the choice?