Bug Heading bb-code does not round-trip as expected

There is a bug in this version
X

Xon

Guest
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>

Continue reading...