quill
quill copied to clipboard
discrepancy in unicode character lengths in quill
discrepancy in unicode character lengths in quill
Steps for Reproduction
- check https://codepen.io/khaled4vokalz/pen/YzqWjgv?editors=0011
- even though
"ő".length === 2
quill considers it as length1
when we doquill.getLength()
but for an emoji e.g."😀".length === 2
quill considers it as length of2
when we doquill.getLength()
- even though
quill.getLength()
returns 1 forő
, if I try to create a delta withő
and checkdelta.length()
that returns2
. This is quite confusing.
Expected behavior:
- as JS returns same length for both the characters quill should do the same
Actual behavior:
- quill.getLength() returns 2 for
ő
and quill.getLength() returns 3 for😀
. quill should have a consistent behavior regarding the length that it calculates
Platforms:
Chromium: 81.0.4044.138, Ubuntu 20.04
Version:
1.3.6
@jhchen can you please review this issue early?
Related https://github.com/quilljs/quill/issues/1230
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide :pray: