From ceed1cfa81de6adcb1f8c28a7f1a46c4a08cac9f Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Fri, 9 Dec 2011 13:53:09 +1100 Subject: [PATCH] Don't continue link over block break. --- source/Editor.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Editor.js b/source/Editor.js index 339a0e5..0872ba6 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -1232,6 +1232,14 @@ var child = nodeAfterSplit.firstChild, next; + // Don't continue links over a block break; unlikely to be the + // desired outcome. + if ( nodeAfterSplit.nodeName === 'A' ) { + nodeAfterSplit.replaceWith( nodeAfterSplit.empty() ); + nodeAfterSplit = child; + continue; + } + while ( child && child.nodeType === TEXT_NODE && !child.data ) { next = child.nextSibling; if ( !next || next.nodeName === 'BR' ) {