File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
packages/test-case-component/src Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -229,11 +229,31 @@ function getSlections(
229
229
}
230
230
231
231
function getThatMarks ( { thatMark } : { thatMark : TargetPlainObject [ ] } ) : DecorationItem [ ] {
232
- console . log ( "☝️" , thatMark )
233
232
const decorations : DecorationItem [ ] = [ ] ;
234
- if ( thatMark === undefined ) {
235
- console . warn ( "thatMarks are undefined. Skipping decoration generation." ) ;
233
+
234
+ if ( thatMark === undefined || thatMark . length === 0 ) {
235
+ console . warn ( "finalStateSourceMarks are undefined. Skipping decoration generation." ) ;
236
+ return [ ]
237
+ } else {
238
+ addContentRangeDecorations ( {
239
+ marks : thatMark ,
240
+ highlightClass : "thatMark" , decorations
241
+ } ) ;
242
+ }
243
+
244
+ return decorations
245
+ }
246
+
247
+ function getSourceMarks ( { sourceMark } : { sourceMark ?: TargetPlainObject [ ] } ) : DecorationItem [ ] {
248
+ const decorations : DecorationItem [ ] = [ ] ;
249
+ if ( sourceMark === undefined || sourceMark . length === 0 ) {
250
+ console . warn ( "finalStateSourceMarks are undefined. Skipping decoration generation." ) ;
236
251
return [ ]
252
+ } else {
253
+ addContentRangeDecorations ( {
254
+ marks : sourceMark ,
255
+ highlightClass : "sourceMark" , decorations
256
+ } ) ;
237
257
}
238
258
239
259
return decorations
You can’t perform that action at this time.
0 commit comments