mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
parent
d8239d2570
commit
4f83b0a8bc
3 changed files with 10 additions and 4 deletions
|
@ -206,7 +206,10 @@ function isLeaf ( node ) {
|
||||||
!!leafNodeNames[ node.nodeName ];
|
!!leafNodeNames[ node.nodeName ];
|
||||||
}
|
}
|
||||||
function isInline ( node ) {
|
function isInline ( node ) {
|
||||||
return inlineNodeNames.test( node.nodeName );
|
return inlineNodeNames.test( node.nodeName ) &&
|
||||||
|
// Malformed HTML can have block tags inside inline tags. Need to treat
|
||||||
|
// these as containers rather than inline. See #239.
|
||||||
|
( node.nodeType === TEXT_NODE || every( node.childNodes, isInline ) );
|
||||||
}
|
}
|
||||||
function isBlock ( node ) {
|
function isBlock ( node ) {
|
||||||
var type = node.nodeType;
|
var type = node.nodeType;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,10 @@ function isLeaf ( node ) {
|
||||||
!!leafNodeNames[ node.nodeName ];
|
!!leafNodeNames[ node.nodeName ];
|
||||||
}
|
}
|
||||||
function isInline ( node ) {
|
function isInline ( node ) {
|
||||||
return inlineNodeNames.test( node.nodeName );
|
return inlineNodeNames.test( node.nodeName ) &&
|
||||||
|
// Malformed HTML can have block tags inside inline tags. Need to treat
|
||||||
|
// these as containers rather than inline. See #239.
|
||||||
|
( node.nodeType === TEXT_NODE || every( node.childNodes, isInline ) );
|
||||||
}
|
}
|
||||||
function isBlock ( node ) {
|
function isBlock ( node ) {
|
||||||
var type = node.nodeType;
|
var type = node.nodeType;
|
||||||
|
|
Loading…
Reference in a new issue