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(
229229}
230230
231231function getThatMarks ( { thatMark } : { thatMark : TargetPlainObject [ ] } ) : DecorationItem [ ] {
232- console . log ( "☝️" , thatMark )
233232 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." ) ;
236251 return [ ]
252+ } else {
253+ addContentRangeDecorations ( {
254+ marks : sourceMark ,
255+ highlightClass : "sourceMark" , decorations
256+ } ) ;
237257 }
238258
239259 return decorations
You can’t perform that action at this time.
0 commit comments