Error in Markdown horizontal rule #581

Closed
opened 2026-01-29 14:40:18 +00:00 by claunia · 2 comments
Owner

Originally created by @NUnitTester on GitHub (Nov 29, 2022).

"Zeile 1\r\n---\r\nZeile 2"
give wrong result
"<h2 id="zeile-1">Zeile 1</h2>\n<p>Zeile 2</p>\n"
instead of
"<p>Zeile 1</p>\n<hr />\n<p>Zeile 2</p>\n"

This works
"Zeile 1\r\n- - - - - - - -\r\nZeile 2"

Example copied from here
stackabuse

Originally created by @NUnitTester on GitHub (Nov 29, 2022). `"Zeile 1\r\n---\r\nZeile 2"` give wrong result `"<h2 id="zeile-1">Zeile 1</h2>\n<p>Zeile 2</p>\n"` instead of `"<p>Zeile 1</p>\n<hr />\n<p>Zeile 2</p>\n"` This works `"Zeile 1\r\n- - - - - - - -\r\nZeile 2"` Example copied from here [stackabuse](https://stackabuse.com/markdown-by-example)
claunia added the questioninvalid labels 2026-01-29 14:40:18 +00:00
Author
Owner

@xoofx commented on GitHub (Nov 30, 2022):

As per the spec for setext, this is expected (it is requiring a blank-line h1 otherwise it is interpreted as a setext heading). See also that all CommonMark compliant engine are producing the same result

@xoofx commented on GitHub (Nov 30, 2022): As per the spec for [setext](https://spec.commonmark.org/0.30/#example-103), this is expected (it is requiring a blank-line h1 otherwise it is interpreted as a setext heading). See also that all CommonMark compliant engine are producing the [same result](https://babelmark.github.io/?text=Zeile+1%0A---%0AZeile+2)
Author
Owner

@NUnitTester commented on GitHub (Dec 1, 2022):

Thanks for clearification

@NUnitTester commented on GitHub (Dec 1, 2022): Thanks for clearification
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#581