Commit c901e06
fix: replace invalid codepoints with U+FFFD in entity parser
entity() emits a literal null byte for � instead of the Unicode
replacement character. The CommonMark spec (section 6.2) requires
U+FFFD for codepoint 0, surrogates (0xD800-0xDFFF), and values
above 0x10FFFF.
Check for all three invalid codepoint categories before converting
to a rune.1 parent a0dc97a commit c901e06
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1333 | 1333 | | |
1334 | 1334 | | |
1335 | 1335 | | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
821 | 826 | | |
822 | 827 | | |
823 | 828 | | |
| |||
0 commit comments