Skip to content

Commit f7e1fa1

Browse files
author
Stefano Malagò
committed
Fixed highlighting adding whitespace before or after selection
1 parent c94193f commit f7e1fa1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

frontend/src/components/v2/tagger_component/ClusterView.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,12 @@ function ClusterItem({answer, taggingClusterSession, dispatchTaggingClusterSessi
120120
const misconception = getCurrentMisconception(taggingClusterSession)
121121
if (misconception == null) return
122122

123+
const start: number = answer.data[e.start] == ' ' ? e.start + 1 : e.start
124+
const end: number = answer.data[e.end] == ' ' ? e.end - 1 : e.end
125+
123126
const newRange: HighlightRangeColor = {
124-
start: e.start,
125-
end: e.end,
127+
start: start,
128+
end: end,
126129
misconception: misconception,
127130
color: taggingClusterSession.currentColor
128131
}

0 commit comments

Comments
 (0)