Setext headings in blockquotes #398

Closed
opened 2026-01-29 14:35:46 +00:00 by claunia · 1 comment
Owner

Originally created by @hamvocke on GitHub (Aug 13, 2020).

There seems to be a problem with Setext headings used within blockquotes.

Take this markdown input:

> Hello
> ----
> this is some other text

Running this on babelmark shows that most renderers will generate a blockquote that contains a heading and a paragraph. Markdig, however, creates a blockquote that contains a paragraph, a horizontal rule and another paragraph.

The CommonMark spec is not absolutely explicit about this case but generally states that --- characters should be treated as a Setext heading if they can be interpreted that way.

Is this something that should be fixed in Markdig to be closer to what other Markdown renderers are doing?

Originally created by @hamvocke on GitHub (Aug 13, 2020). There seems to be a problem with [Setext headings](https://spec.commonmark.org/0.29/#setext-heading) used within blockquotes. Take this markdown input: ``` > Hello > ---- > this is some other text ``` Running this on [babelmark](https://babelmark.github.io/?text=%3E+Hello%0A%3E+----%0A%3E+this+is+some+other+text) shows that most renderers will generate a blockquote that contains a heading and a paragraph. Markdig, however, creates a blockquote that contains a paragraph, a horizontal rule and another paragraph. The CommonMark spec is not absolutely explicit about this case but [generally states](https://spec.commonmark.org/0.29/#example-29) that `---` characters should be treated as a Setext heading if they can be interpreted that way. Is this something that should be fixed in Markdig to be closer to what other Markdown renderers are doing?
claunia added the bugPR Welcome! labels 2026-01-29 14:35:46 +00:00
Author
Owner

@xoofx commented on GitHub (Aug 16, 2020):

It's definitely a bug, don't have time to look at this, but in case you have, PR welcome.

@xoofx commented on GitHub (Aug 16, 2020): It's definitely a bug, don't have time to look at this, but in case you have, PR welcome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#398