File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/markdown-slate/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -341,12 +341,12 @@ class ToSlateVisitor {
341341
342342 // Cleanup block node for Slate
343343 if ( result . object === 'block' || result . object === 'inline' ) {
344- const bufferText = { object : 'text' , text : '' } ;
344+ const emptyText = ( ) => { return { object : 'text' , text : '' } ; } ;
345345 if ( ! result . data ) {
346346 result . data = { } ;
347347 }
348348 if ( ! result . children || result . children . length === 0 ) {
349- result . children = [ bufferText ] ;
349+ result . children = [ emptyText ( ) ] ;
350350 }
351351 if ( result . children && result . children . length > 0 ) {
352352 const normalizedChildren = [ ] ;
@@ -359,9 +359,9 @@ class ToSlateVisitor {
359359 normalizedChildren . length === 0 ||
360360 normalizedChildren [ normalizedChildren . length - 1 ] . object === 'inline'
361361 ) {
362- normalizedChildren . push ( bufferText , child ) ;
362+ normalizedChildren . push ( emptyText ( ) , child ) ;
363363 } else if ( isLast ) {
364- normalizedChildren . push ( child , bufferText ) ;
364+ normalizedChildren . push ( child , emptyText ( ) ) ;
365365 } else {
366366 normalizedChildren . push ( child ) ;
367367 }
You can’t perform that action at this time.
0 commit comments