-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix handling of astral character reference #158
Conversation
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #158 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 57 57
Lines 11936 11936
=========================================
Hits 11936 11936
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
d722d2f
to
21a77fc
Compare
This comment has been minimized.
This comment has been minimized.
Thanks! |
Our linter |
Thanks for the quick turnaround 🙂 |
Initial checklist
Description of changes
decodeNumericCharacterReference
was usingString.fromCharCode
which only handles UTF-16 code units, not true codepoints. Any characters not representable by a single UTF-16 code unit ("astral characters") would come out incorrectly.Note that there are other uses of
String.fromCharCode
in micromark. These should also be examined. The current behaviour is a regression that was introduced 4 months ago by bbb726d, although the correct version only existed for 3 days prior to that 🙂 — the very first version of the function had the same problem.