Remove zero-width space (#1475)
This commit is contained in:
parent
0dab38f0a6
commit
0e705292cc
@ -462,7 +462,8 @@ class DOMTextScanner {
|
|||||||
return preserveWhitespace ? 2 : 1;
|
return preserveWhitespace ? 2 : 1;
|
||||||
case 0x0a: // Line feed ('\n')
|
case 0x0a: // Line feed ('\n')
|
||||||
return preserveNewlines ? 3 : 1;
|
return preserveNewlines ? 3 : 1;
|
||||||
case 0x200c: // Zero-width non-joiner ('\u200c')
|
case 0x200b: // Zero-width space
|
||||||
|
case 0x200c: // Zero-width non-joiner
|
||||||
return 0;
|
return 0;
|
||||||
default: // Other
|
default: // Other
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -138,8 +138,8 @@ class TextSourceElement {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove zero-width non-joiner
|
// Remove zero-width space and zero-width non-joiner
|
||||||
content = content.replace(/\u200c/g, '');
|
content = content.replace(/[\u200b\u200c]/g, '');
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user