Skip to content

Commit d4b5858

Browse files
author
hoang.tran12
committed
fix
1 parent 1e3c1aa commit d4b5858

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/detect_zeroWidthCharacters.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export default {
2222
const regExp = new RegExp(`([${zeroWidthCharacters}])`, "g");
2323
element.innerHTML = element.innerHTML.replace(
2424
regExp,
25-
'$1<span class="zero-width-character"></span>'
25+
// '$1<span class="zero-width-character"></span>'
26+
'<span class="zero-width-character"></span>'
2627
);
2728
};
2829
// From: https://jsfiddle.net/tim333/np874wae/13/
@@ -53,7 +54,6 @@ export default {
5354
const checkPage = function () {
5455
const allElements = document.getElementsByTagName("*");
5556
[...allElements].forEach(checkElement);
56-
console.log(elementsWithZWCC);
5757
elementsWithZWCC.forEach(function (element) {
5858
element.classList.add("zero-width-characters");
5959
highlightCharacters(element);
@@ -70,6 +70,8 @@ export default {
7070

7171
// Check Page
7272
checkPage();
73+
setTimeout(checkPage, 5000);
74+
7375
// Check page again when any input field is changed
7476
const inputs = document.querySelectorAll("input");
7577
[...inputs].forEach(function (input) {

0 commit comments

Comments
 (0)