2

I know that in order to make an header, you need to add === in the following line.

This is an example.

However, sometimes you need to add an header under a quote, because it is part of the text you want to quote.

So I thought I can do something like that:

enter image description here

Which seems to work great in the preview, but then when publishing, this is the result:

enter image description here

Should that work? Am I doing something wrong? This is the post I used as a reference(I have edited it, so the current version has an header using ): https://stackoverflow.com/a/65394980/2359227

4
  • So... I can understand if y'all think this is separate since it uses equals signs instead of dashes but it seems, generally, to be the same issue.
    – Catija StaffMod
    Dec 21, 2020 at 15:42
  • Can you check if this is working correctly now? The duplicate has been marked as status-completed. :)
    – Catija StaffMod
    Jan 4, 2021 at 15:27
  • @Catija I see now that it does work, am I wrong? Jan 4, 2021 at 15:38
  • You aren't wrong! The error was on my part - I failed to put a space between the > and the === - this is still somewhat of an error since it renders in the preview as being a header but with the space the formatting works as expected. This is likely something we should fix in the preview, though, since I believe the space is necessary.
    – Catija StaffMod
    Jan 4, 2021 at 15:39

2 Answers 2

6

My preferred way to make headers is with hashes:

New Packages

Content for the paragraph.

This works cleanly and plays nicely with all markdown.

> ## New Packages
>
> Content for the paragraph.

It also allows you to choose from three levels of header using single, double or triple hash marks.

As a note, this is part of a known issue - Quoted headings are rendered properly on preview but not when posted which is now fixed, so your formatting choice should work just fine now! I've tested this by editing your Stack Overflow post to the ==== formatting style and confirmed that it works now.

2

You can use three hash signs to indicate a header as well, and it works within blockquotes:

> ### Test
> test

produces

Test

test


I'm not sure how this is supposed to work under CommonMark, it's interesting to see that something different happens when you use hyphens: ---- instead of equal signs:

> Test
> ----
> test

produces

Test


test

even though, as in your case, the preview renders it correctly.

0

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