Fixed bug #16245: htmlArea RTE: When inserting link with IE8, trailing line break...
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 8 Nov 2010 15:50:53 +0000 (15:50 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 8 Nov 2010 15:50:53 +0000 (15:50 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9306 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js

index 725c61f..c5eccdd 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-08  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #16245: htmlArea RTE: When inserting link with IE8, trailing line break is also linked
+
 2010-11-07  Steffen Gebert  <steffen@steffen-gebert.de>
 
        * Fixed bug #16246: Create class constants for pages.doktype
index e8f87e8..5678727 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-08  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #16245: htmlArea RTE: When inserting link with IE8, trailing line break is also linked
+
 2010-11-07  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #16293: htmlArea RTE: Add quick tips to insert emoticon dialogue
index 64bca15..aa6f5f2 100644 (file)
@@ -229,6 +229,13 @@ HTMLArea.TYPO3Link = HTMLArea.Plugin.extend({
                el = HTMLArea.getElementObject(node, "a");
                if (el != null && /^a$/i.test(el.nodeName)) node = el;
                if (node) {
+                               // Export trailing br that IE may include in the link
+                       if (Ext.isIE) {
+                               if (node.lastChild && /^br$/i.test(node.lastChild.nodeName)) {
+                                       HTMLArea.removeFromParent(node.lastChild);
+                                       node.parentNode.insertBefore(this.editor.document.createElement('br'), node.nextSibling);
+                               }
+                       }
                        if (HTMLArea.classesAnchorSetup && cur_class) {
                                for (var i = HTMLArea.classesAnchorSetup.length; --i >= 0;) {
                                        anchorClass = HTMLArea.classesAnchorSetup[i];