From 54ba1dea3312e42a0d70d6a0142fbc97e541da94 Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Wed, 5 Jun 2024 09:47:57 +0200 Subject: [PATCH] Push ruleType into matches object, since it is needed later to correctly reposition markup --- service2.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/service2.js b/service2.js index 158ef31..b07e194 100644 --- a/service2.js +++ b/service2.js @@ -484,7 +484,8 @@ class BesTreeService extends BesService { rects: clientRects, highlights: highlights, range: range, - match: match + match: match, + ruleType: ruleType }) }) this.markProofed(node, matches) @@ -549,7 +550,10 @@ class BesTreeService extends BesService { repositionAllMarkup() { this.results.forEach(result => { result.matches.forEach(match => { - const { clientRects, highlights } = this.addMistakeMarkup(match.range) + const { clientRects, highlights } = this.addMistakeMarkup( + match.range, + match.ruleType + ) match.rects = clientRects if (match.highlights) match.highlights.forEach(h => h.remove()) match.highlights = highlights @@ -1287,7 +1291,10 @@ class BesPlainTextService extends BesService { repositionAllMarkup() { this.results.forEach(result => { result.matches.forEach(match => { - const { clientRects, highlights } = this.addMistakeMarkup(match.range) + const { clientRects, highlights } = this.addMistakeMarkup( + match.range, + match.ruleType + ) match.rects = clientRects if (match.highlights) match.highlights.forEach(h => h.remove()) match.highlights = highlights