File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -59,18 +59,14 @@ const fixContainer = (
5959 container : Node ,
6060 root : Element | DocumentFragment ,
6161) : Node => {
62- const children = container . childNodes ;
6362 let wrapper : HTMLElement | null = null ;
64- for ( let i = 0 , l = children . length ; i < l ; i += 1 ) {
65- const child = children [ i ] ;
63+ [ ...container . childNodes ] . forEach ( child => {
6664 const isBR = child . nodeName === 'BR' ;
6765 if ( ! isBR && isInline ( child ) ) {
6866 if ( ! wrapper ) {
6967 wrapper = createElement ( 'DIV' ) ;
7068 }
7169 wrapper . appendChild ( child ) ;
72- i -= 1 ;
73- l -= 1 ;
7470 } else if ( isBR || wrapper ) {
7571 if ( ! wrapper ) {
7672 wrapper = createElement ( 'DIV' ) ;
@@ -80,15 +76,13 @@ const fixContainer = (
8076 container . replaceChild ( wrapper , child ) ;
8177 } else {
8278 container . insertBefore ( wrapper , child ) ;
83- i += 1 ;
84- l += 1 ;
8579 }
8680 wrapper = null ;
8781 }
8882 if ( isContainer ( child ) ) {
8983 fixContainer ( child , root ) ;
9084 }
91- }
85+ } ) ;
9286 if ( wrapper ) {
9387 container . appendChild ( fixCursor ( wrapper ) ) ;
9488 }
You can’t perform that action at this time.
0 commit comments