summaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js')
-rw-r--r--ext/js/dom/dom-text-scanner.js3
-rw-r--r--ext/js/dom/text-source-element.js4
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/js/dom/dom-text-scanner.js b/ext/js/dom/dom-text-scanner.js
index 71e74fc3..8010dd97 100644
--- a/ext/js/dom/dom-text-scanner.js
+++ b/ext/js/dom/dom-text-scanner.js
@@ -462,7 +462,8 @@ class DOMTextScanner {
return preserveWhitespace ? 2 : 1;
case 0x0a: // Line feed ('\n')
return preserveNewlines ? 3 : 1;
- case 0x200c: // Zero-width non-joiner ('\u200c')
+ case 0x200b: // Zero-width space
+ case 0x200c: // Zero-width non-joiner
return 0;
default: // Other
return 2;
diff --git a/ext/js/dom/text-source-element.js b/ext/js/dom/text-source-element.js
index 1576bd5e..499ee45d 100644
--- a/ext/js/dom/text-source-element.js
+++ b/ext/js/dom/text-source-element.js
@@ -138,8 +138,8 @@ class TextSourceElement {
break;
}
- // Remove zero-width non-joiner
- content = content.replace(/\u200c/g, '');
+ // Remove zero-width space and zero-width non-joiner
+ content = content.replace(/[\u200b\u200c]/g, '');
return content;
}