File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -780,6 +780,15 @@ export function isBlock(node) {
780
780
if ( tagName . startsWith ( 'JW-' ) || tagName === 'T' ) {
781
781
return true ;
782
782
}
783
+ if ( tagName === 'BR' ) {
784
+ // A <br> is always inline but getComputedStyle(br).display mistakenly
785
+ // returns 'block' if its parent is display:flex (at least on Chrome and
786
+ // Firefox (Linux)). Browsers normally support setting a <br>'s display
787
+ // property to 'none' but any other change is not supported. Therefore
788
+ // it is safe to simply declare that a <br> is never supposed to be a
789
+ // block.
790
+ return false ;
791
+ }
783
792
// The node might not be in the DOM, in which case it has no CSS values.
784
793
if ( window . document !== node . ownerDocument ) {
785
794
return blockTagNames . includes ( tagName ) ;
You can’t perform that action at this time.
0 commit comments