rustle
rustle copied to clipboard
Entities util duplicates in from_code
In src/compiler/parse/utils/entities.rs
. from_code
method matches duplicate two codes to both Entity::nbsp
and Entity::NonBreakingSpace
. It will cause the second statement to be never reached.
160 => Entity::NonBreakingSpace, 160 => Entity::nbsp,
Yeah I copied all the types directly from the svelte repo. Also, the code links to this website where it notes
It is intentional, for legacy compatibility, that many code points have multiple character reference names. For example, some appear both with and without the trailing semicolon, or with different capitalizations.
Maybe if the Entities
enum is rewritten as a HashMap, that would be better?