File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ export const findAndReplace =
136136 const replace = pairs [ pairIndex ] [ 1 ]
137137 let start = 0
138138 // @ts -expect-error: TS is wrong, some of these children can be text.
139- let index = parent . children . indexOf ( node )
139+ const index = parent . children . indexOf ( node )
140140 /** @type {Array<PhrasingContent> } */
141141 let nodes = [ ]
142142 /** @type {number|undefined } */
@@ -188,7 +188,6 @@ export const findAndReplace =
188188
189189 if ( position === undefined ) {
190190 nodes = [ node ]
191- index --
192191 } else {
193192 if ( start < node . value . length ) {
194193 nodes . push ( { type : 'text' , value : node . value . slice ( start ) } )
@@ -197,7 +196,7 @@ export const findAndReplace =
197196 parent . children . splice ( index , 1 , ...nodes )
198197 }
199198
200- return index + nodes . length + 1
199+ return index + nodes . length
201200 }
202201 }
203202 )
You can’t perform that action at this time.
0 commit comments