File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ export const findAndReplace =
136
136
const replace = pairs [ pairIndex ] [ 1 ]
137
137
let start = 0
138
138
// @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 )
140
140
/** @type {Array<PhrasingContent> } */
141
141
let nodes = [ ]
142
142
/** @type {number|undefined } */
@@ -188,7 +188,6 @@ export const findAndReplace =
188
188
189
189
if ( position === undefined ) {
190
190
nodes = [ node ]
191
- index --
192
191
} else {
193
192
if ( start < node . value . length ) {
194
193
nodes . push ( { type : 'text' , value : node . value . slice ( start ) } )
@@ -197,7 +196,7 @@ export const findAndReplace =
197
196
parent . children . splice ( index , 1 , ...nodes )
198
197
}
199
198
200
- return index + nodes . length + 1
199
+ return index + nodes . length
201
200
}
202
201
}
203
202
)
You can’t perform that action at this time.
0 commit comments