0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-21 22:12:32 -05:00

If can't split block, wrap inlines instead.

When cleaning up <br>s, if it's inside a block we can't split, it's probably a
containing node (like a <blockquote>), so we should wrap the top level inlines
instead.
This commit is contained in:
Neil Jenkins 2013-03-07 18:12:18 +11:00
parent a340115a87
commit 6927928a79
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -1267,7 +1267,7 @@
}
// If this is not inside a block, replace it by wrapping
// inlines in DIV.
if ( !block.isBlock() ) {
if ( !block.isBlock() || !tagAfterSplit[ block.nodeName ] ) {
wrapTopLevelInline( block, 'DIV' );
}
// If in a block we can split, split it instead, but only if there
@ -1275,7 +1275,7 @@
// placeholder to stop the block from collapsing, so we must leave
// it.
else {
if ( tagAfterSplit[ block.nodeName ] && brBreaksLine[l] ) {
if ( brBreaksLine[l] ) {
splitBlock( block, br.parentNode, br );
}
br.detach();