Skip to content

Commit

Permalink
highlight inserted hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
mi2ebi committed Mar 3, 2024
1 parent f7b2122 commit 68bf463
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions events.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ id("search").addEventListener("input", function() {
const hyphens = ["r", "n", "y", "'y", "y'", "'y'"];
for (var m = 0, b = 0; m < mabla.length; m++, b++) {
if (hyphens.includes(mabla[m])) {
m++;
}
if (hyphens.includes(best[b])) {
id("best").append(createHTMLElement("i", null, [best[b]]));
b++;
if (!hyphens.includes(best[b])) {
m++;
} else if (hyphens.includes(best[b]) && mabla[m] == best[b]) {
m++; b++;
}
} else if (hyphens.includes(best[b])) {
mabla.splice(m, 0, "");
}
if (mabla[m] != best[b]) {
id("best").append(createHTMLElement("i", {"className": "err"}, [best[b]]));
Expand Down

0 comments on commit 68bf463

Please sign in to comment.