var replaced = mpFormatCollapsed.call(this, tag, attr, value, type);
- for (var i = 0, length = replaced.length; i < length; i++) {
- this.WoltLabBlock._paragraphize(replaced[i]);
+ var length = replaced.length;
+ if (length === 1 && replaced[0].nodeName.match(/^H[1-6]$/)) {
+ var hX = replaced[0];
+ // <hX><br></hX> behaves weird
+ if (hX.childElementCount === 1 && hX.children[0].nodeName === 'BR' && this.utils.isEmpty(hX.innerHTML)) {
+ hX.innerHTML = '\u200B';
+ }
+ }
+ else {
+ for (var i = 0; i < length; i++) {
+ this.WoltLabBlock._paragraphize(replaced[i]);
+ }
}
this.caret.end(replaced);