-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
there's zwnj too #4
Comments
@simevo I'm having a look at this issue. How did you make up the expected sizes in the proposed unit tests? (it's not on the wikipedia page) |
All those tests pass with the string-width library as it is, so they are there only to confirm reproducible behavior. The right number of columns required to display some of those sequence is debatable and probably not unique. |
Thanks.
That's what I feared. Thus I won't integrate those unit tests while I'm not sure of what I'm doing. I'll copy the one I understand (emojis ;)) Thanks a lot for sharing! |
Related to #2, there is also zero-width non-joiners (ZWNJ).
I'm in the process of packaging string-width in Debian, and as a low-cost, acceptable solution to all these problems I propose to replace the dependency on
is-fullwidth-code-point
withwcwidth.js
. This patch does the trick:https://anonscm.debian.org/git/pkg-javascript/node-string-width.git/tree/debian/patches/01-wcwidth.diff
We've created a minimal test suite of strings with zwj and zwnj, you can find it here:
https://anonscm.debian.org/git/pkg-javascript/node-string-width.git/tree/debian/patches/02-test_zwj_zwnj.diff
[sorry we also switched from ava to mocha since ava is not available yet in Debian ...; run them with
mocha -u tdd
]As pointed out in #2, the right number of columns required to display an emoji zwj sequence is debatable, so the tests are only there to guarantee we're at least reproducible.
The text was updated successfully, but these errors were encountered: