// is flawed when the previous element is a list. Their current implementation
// inserts the content straight into the list element, rather than appending it
// to the last possible location inside a <li>.
+ var br = null;
if (e.which === this.keyCode.BACKSPACE && this.detect.isFirefox()) {
var block = this.selection.block();
if (block && block.tagName === 'P' && this.utils.isStartOfElement(block)) {
e.preventDefault();
return;
}
+ else if (previousBlock && previousBlock.nodeName === 'P') {
+ // Firefox moves the <br> of a previous <p><br></p> into the current container instead of removing the <br> along with the <p>.
+ br = previousBlock.lastElementChild;
+ if (br !== null && br.nodeName !== 'BR') {
+ br = null;
+ }
+ }
}
}
}
}
}
+ else if (br !== null && this.detect.isFirefox()) {
+ var range = selection.getRangeAt(0);
+ if (range.startOffset === 1 && range.startContainer.firstElementChild === br) {
+ elRemove(br);
+ }
+ }
}).bind(this);
var ua = window.navigator.userAgent.toLowerCase();