File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
packages/test-case-component/src Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,28 @@ function isPositionRange(
255
255
&& range . type === "character" ;
256
256
}
257
257
258
+ function addContentRangeDecorations ( {
259
+ marks,
260
+ highlightClass,
261
+ decorations,
262
+ } : {
263
+ marks : TargetPlainObject [ ] ;
264
+ highlightClass : keyof typeof classesMap ;
265
+ decorations : DecorationItem [ ] ;
266
+ } ) : void {
267
+ marks . forEach ( ( { contentRange } ) => {
268
+ const { start, end } = contentRange ;
269
+ const decorationItem = {
270
+ start,
271
+ end,
272
+ properties : {
273
+ class : getDecorationClass ( highlightClass ) ,
274
+ } ,
275
+ alwaysWrap : true ,
276
+ } ;
277
+ decorations . push ( decorationItem ) ;
278
+ } ) ;
279
+ }
258
280
259
281
const DEFAULT_HAT_CLASS = "hat default" ;
260
282
const classesMap = {
You can’t perform that action at this time.
0 commit comments