Index: typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (révision 7667) +++ typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail) @@ -3064,7 +3064,13 @@ var range = this._createRange(selection); if (!Ext.isIE) { var parentStart = range.startContainer; + if (/^(body)$/i.test(parentStart.nodeName)) { + parentStart = parentStart.firstChild; + } var parentEnd = range.endContainer; + if (/^(body)$/i.test(parentEnd.nodeName)) { + parentEnd = parentEnd.lastChild; + } } else { if (selection.type !== "Control" ) { var rangeEnd = range.duplicate(); Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (révision 7667) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (copie de travail) @@ -655,38 +655,40 @@ if (endBlocks.start === endBlocks.end) { --index; } - for (var block = startAncestors[index]; block; block = block.nextSibling) { - if (HTMLArea.isBlockElement(block)) { - switch (buttonId) { - case "Indent" : - if (!HTMLArea._hasClass(block, this.useClass[buttonId])) { - HTMLArea._addClass(block, this.useClass[buttonId]); - } - break; - case "Outdent" : - if (HTMLArea._hasClass(block, this.useClass["Indent"])) { - HTMLArea._removeClass(block, this.useClass["Indent"]); - } - break; - case "JustifyLeft" : - case "JustifyCenter" : - case "JustifyRight" : - case "JustifyFull" : - this.toggleAlignmentClass(block, buttonId); - break; - default : - if (this.standardBlockElements.test(buttonId.toLowerCase()) && buttonId.toLowerCase() == block.nodeName.toLowerCase()) { - this.cleanClasses(block); - if (className) { - HTMLArea._addClass(block, className); + if (!/^(body)$/i.test(startAncestors[index].nodeName)) { + for (var block = startAncestors[index]; block; block = block.nextSibling) { + if (HTMLArea.isBlockElement(block)) { + switch (buttonId) { + case "Indent" : + if (!HTMLArea._hasClass(block, this.useClass[buttonId])) { + HTMLArea._addClass(block, this.useClass[buttonId]); } - } - break; + break; + case "Outdent" : + if (HTMLArea._hasClass(block, this.useClass["Indent"])) { + HTMLArea._removeClass(block, this.useClass["Indent"]); + } + break; + case "JustifyLeft" : + case "JustifyCenter" : + case "JustifyRight" : + case "JustifyFull" : + this.toggleAlignmentClass(block, buttonId); + break; + default : + if (this.standardBlockElements.test(buttonId.toLowerCase()) && buttonId.toLowerCase() == block.nodeName.toLowerCase()) { + this.cleanClasses(block); + if (className) { + HTMLArea._addClass(block, className); + } + } + break; + } } + if (block == endAncestors[index]) { + break; + } } - if (block == endAncestors[index]) { - break; - } } },