11

With markdown, you can use some dashes for headings. For example, this:

Hello
----
this is some other text

renders as this:

Hello

this is some other text

This is fine and works well. When I want to quote that text is when the problem arises, since this Markdown:

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

When written down shows well in the preview but not when posted:

Hello

this is some other text


As an example, see an screenshot of the preview:

enter image description here

and a screenshot of the posted content, where the ---- becomes a <hr>:

enter image description here

Note a similar bug I also reported: <s>links</s> are autocompleted on preview but not rendered when posted.

6
  • This isn't a solution, per se... but using # instead of --- is going to be more repeatable since the dashes are used for horizontal lines and headers. – Catija Jul 22 '20 at 13:49
  • indeed, thanks @Catija. I normally use # also, only that I found out about this situation when formatting a post today. – fedorqui 'SO stop harming' Jul 22 '20 at 13:51
  • 1
    This is one of the cases where our client-side markdown renderer is behaving differently than our server-side renderer. As I see it the CommonMark spec suggests that this example should indeed be a heading instead of a a horizontal rule. I'll file a bug with our server-side markdown library and see if we can make this consistent. In the meantime, using # is the way to avoid this. – Ham Vocke Aug 12 '20 at 15:22
  • 1
    Cross-site duplicate on MSO: Inconsistency between preview and actual snippet when adding quotes. – Sebastian Simon Sep 1 '20 at 12:37
  • 1
    Note that there is a similar problem using === headings in quoted text. These render as expected in the preview, but are shown as literal === characters in the actual post. – HappyDog Dec 14 '20 at 13:25
  • @Sonic the question was displaying a bug, why the revision to Rebake post so it shows correctly? Now the post does not make sense. If you wanted to do so, you could have added a screenshot of how it showed incorrectly before the fix added yesterday, so people would understand. – fedorqui 'SO stop harming' Jan 5 at 6:32
8

This bug has been fixed in Markdig, the server-side Markdown renderer we're using. I just updated the version we use to the one including the bugfix for this specific issue. Moving forward, you should see a proper level-2 heading in blockquotes with the syntax you gave in your example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .