WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 8d835fa

Browse files
Merge branch 'main' of github.com:MicrosoftEdge/Demos
2 parents fa12a4a + 7549884 commit 8d835fa

File tree

1 file changed

+4
-1
lines changed
  • custom-highlight-api/highlightsFromPoint

1 file changed

+4
-1
lines changed

custom-highlight-api/highlightsFromPoint/script.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ function createHighlightsForWords(textNodes, words, highlightName) {
6565

6666
// If we found any words/phrases, create and register the highlight with the respective ranges
6767
if (ranges.length > 0) {
68-
const highlight = new Highlight(...ranges);
68+
let highlight = new Highlight(...ranges);
69+
if (["spelling-error", "grammar-error"].includes(highlightName)) {
70+
highlight.type = highlightName;
71+
}
6972
CSS.highlights.set(highlightName, highlight);
7073
}
7174
}

0 commit comments

Comments
 (0)