Co-authored-by: fisker <lionkay@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1.2 KiB
1.2 KiB
Escape unindented indented pseudo setext headers (#19350 by @tats-u)
Indented lines composed of only = or - were previously unindented without being escaped, which caused them to be mistakenly parsed as setext headers. With this change, Prettier now escapes such lines to prevent the misinterpretation:
Check parse results on CommonMark playground
<!-- Input -->
Not a header
===
Not a header
---
Not a list item or a header
-
<!-- Prettier stable -->
Not a header
===
Not a header
---
Not a list item or a header -
<!-- Prettier main -->
Not a header
\===
Not a header
\---
Not a list item or a header
\-