Repository navigation
PATCH: a new export before 1.0. The new entry @mark1russell7/text/references has decodeReferences. The root entry and the entry ./html do not change.
decodeReferences(text)decodes the character references of HTML content, as the tokenizer of the HTML Living Standard does.- The named references come from the table of the standard, with its 2231 names. The longest name wins, and the 106 legacy names are also correct with no semicolon.
- A decimal or hexadecimal reference gives its code point. The value 0, a surrogate and a value above
0x10FFFFgive U+FFFD, and0x80to0x9Fgive the characters of windows-1252. - An ampersand with no reference stays as text. The function does not throw, and it is linear in the length of the text.
- The script
scripts/html-references.tsmakes the table modulesrc/html-references.tsfromentities.jsonof the standard (CC BY 4.0). - The first prediction put the decoder in
./html, with a limit of 9000 bytes. The entry had 9425 bytes in CI. So the decoder is in its own entry,./references, with a limit of 9000 bytes. The limit of./htmlstays at 1100 bytes. - The first users are the alert sources with HTML descriptions in a feed. News feeds need the same function.
Runtime dependencies: no change against 0.0.15 (none).