Heading bb-code does not round-trip as expected

Xon

Well-known member
Affected version
2.2.6 Patch 2
If you enter the bb-code;
Code:
[B][HEADING=1]1[/HEADING][/B]

And then toggle bb-code mode on & off, this causes a newline to be inserted before the heading. This is because of the following HTML being generated;
Code:
<p><strong><h2>1</h2><p></strong></p>
 
Toggling [B][HEADING=1]1[/HEADING][/B] in XF2.3 still an unexpected new line, but then toggling against converts to [HEADING=1][B]1[/B][/HEADING] which then reliable roundtrips (and eats the unexpected new line).

The first html is:
XML:
<p><strong><h2>1</h2><p></strong></p>

While the 2nd html is:
XML:
<h2><strong>1</strong></h2>
 
Top Bottom