fix: allow characters in the supplementary special-purpose plane (#15823)

fixes #15821

Source: https://en.wikipedia.org/wiki/Plane_(Unicode)#Supplementary_Special-purpose_Plane
pull/15848/head
Simon H 5 months ago committed by GitHub
parent 018996c167
commit 1c2fc21023
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow characters in the supplementary special-purpose plane

@ -72,6 +72,8 @@ const NUL = 0;
// to replace them ourselves // to replace them ourselves
// //
// Source: http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Illegal_characters // Source: http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Illegal_characters
// Also see: https://en.wikipedia.org/wiki/Plane_(Unicode)
// Also see: https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream
/** @param {number} code */ /** @param {number} code */
function validate_code(code) { function validate_code(code) {
@ -116,5 +118,10 @@ function validate_code(code) {
return code; return code;
} }
// supplementary special-purpose plane 0xe0000 - 0xe07f and 0xe0100 - 0xe01ef
if ((code >= 917504 && code <= 917631) || (code >= 917760 && code <= 917999)) {
return code;
}
return NUL; return NUL;
} }

Loading…
Cancel
Save