Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js
===================================================================
--- typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (révision 7960)
+++ typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (copie de travail)
@@ -229,8 +229,12 @@
element = "<" + element + ">";
}
this.editor.focusEditor();
- if (HTMLArea.is_safari && !this.editor._doc.body.hasChildNodes()) {
- this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
+ if (HTMLArea.is_safari) {
+ if (!this.editor._doc.body.hasChildNodes()) {
+ this.editor._doc.body.appendChild((this.editor._doc.createElement("br")));
+ }
+ // WebKit sometimes leaves empty block at the end of the selection
+ this.editor._doc.body.normalize();
}
try {
this.editor._doc.execCommand(buttonId, false, element);