1

Seen at: https://unix.stackexchange.com/revisions/34012/3 with Firefox on Ubuntu 20.04,


<br/>
text `code` **bold**

more text

Renders as:

bogus formatting

Instead of:

expected formatting

The generated HTML is:

<br/>
text `code` **bold**
<p>more text</p>

instead of:

<p><br>text <code>code</code> <strong>bold</strong></p>
<p>more text</p>

Currently in your browser:


text `code` **bold**

more text

That doesn't happen if the line above the <br/> is not blank or there are non-blanks around <br/> as in:

text
<br/>
test

Or


<br/>text

Example in your browser:


text code bold

more text

2
  • But why use <br/> at all? I think that generally, most markdown is disabled if it has another "command" above it, like --- requiring an empty line in order for it to be rendered as a horizontal line, but is this a problem? If you just leave an empty line instead of the br tag doesn't it work?
    – terdon Mod
    Jan 18 at 12:32
  • 1
    @terdon, I wouldn't do that myself, I'm just reporting a rendering bug. Jan 18 at 12:59

1 Answer 1

3

This is the expected behavior according to the Commonmark spec (link against the reference implementation).

The <br/> constitutes opening an HTML block , which (for most start conditions) is only terminated by a blank line. In the Commonmark reference spec for HTML block, the appropriate condition here is number 7.

You must log in to answer this question.

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