mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 13:16:31 -05:00
Don't continue link over block break.
This commit is contained in:
parent
cfe9bea8b3
commit
ceed1cfa81
1 changed files with 8 additions and 0 deletions
|
@ -1232,6 +1232,14 @@
|
||||||
var child = nodeAfterSplit.firstChild,
|
var child = nodeAfterSplit.firstChild,
|
||||||
next;
|
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 ) {
|
while ( child && child.nodeType === TEXT_NODE && !child.data ) {
|
||||||
next = child.nextSibling;
|
next = child.nextSibling;
|
||||||
if ( !next || next.nodeName === 'BR' ) {
|
if ( !next || next.nodeName === 'BR' ) {
|
||||||
|
|
Loading…
Reference in a new issue