commonmark/commonmark-spec

Empty line needed after raw <h> tag. Is this a bug or feature?

Closed this issue · 2 comments

This results in the text getting wrapped in <p> tag:

<h1>Title</h1>

text below

https://spec.commonmark.org/dingus/?text=%3Ch1%3ETitle%3C%2Fh1%3E%0A%0Atext%20below%0A

This does not:

<h1>Title</h1>
text below

https://spec.commonmark.org/dingus/?text=%3Ch1%3ETitle%3C%2Fh1%3E%0Atext%20below

I don't see anything about that in the spec.

jgm commented

Look at the rules for raw HTML blocks.
https://spec.commonmark.org/0.31.2/#html-blocks
This is a type 6 HTML block, so it ends with a blank line.

@jgm -- Ok. Makes sense. I didn't quite parse that as "It's not over until there is a completely blank line". For some reason, I read it as "the rest of the line is blank". But it's clear now.