0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Don't continue link over block break.

This commit is contained in:
Neil Jenkins 2011-12-09 13:53:09 +11:00
parent cfe9bea8b3
commit ceed1cfa81

View file

@ -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' ) {