Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/numeric-character-reference-planes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: decode numeric character references in the tertiary ideographic and supplementary private use planes
9 changes: 7 additions & 2 deletions packages/svelte/src/compiler/phases/1-parse/utils/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ function validate_code(code, is_attribute_value) {
return code;
}

// supplementary ideographic plane 0x20000 - 0x2ffff
if (code >= 131072 && code <= 196607) {
// supplementary and tertiary ideographic planes 0x20000 - 0x3ffff
if (code >= 131072 && code <= 262143) {
return code;
}

Expand All @@ -130,5 +130,10 @@ function validate_code(code, is_attribute_value) {
return code;
}

// supplementary private use area planes 0xf0000 - 0x10ffff
if (code >= 983040 && code <= 1114111) {
return code;
}

return NUL;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export default test({
<span>A</span>
<span>€</span>
<span>€</span>
<span>\u{30EDD}</span>
<span>\u{F0001}</span>
<span title="\u{30EDD}\u{10FFFD}">x</span>

<span>&amp;stringnotanentity;</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<span>&#65;</span>
<span>&#128;</span>
<span>&#128</span>
<span>&#x30EDD;</span>
<span>&#xF0001;</span>
<span title="&#x30EDD;&#x10FFFD;">x</span>

<span>&stringnotanentity;</span>

Expand Down