tur/markdown/entities
the HTML named character references, for &name; in Markdown.
GENERATED by tools/gen-html-entities.py -- do not edit; regenerate. The table is the HTML Standard's: the 2125 names that end in ';' (CommonMark reads no entity without one), from a source pinned by a digest of the table. The C below is also src/turi/html_entities.inc, which the interpreter compiles in and registers as natives over the two wrappers.
Since: markdown-library-plan U2
markdown/-entity-find__
(markdown/-entity-find__ [name :cstr] :int)
internal: the index of the entity named name, or -1.
markdown/-entity-cp__
(markdown/-entity-cp__ [i :int k :int] :int)
internal: code point k (0 or 1) of entity i, or 0.
markdown/entity-lookup
(markdown/entity-lookup [name :String] :(Option String))
the text an HTML named character reference stands for.
name is the reference without its & and ;: "copy" for ©. Names are case-sensitive, as in HTML ("AMP" and "amp" are both entities, "Amp" is not), and a name the HTML Standard lists only without a semicolon is not found, as CommonMark requires. Most entities are one code point; a few, such as "ngE", are two.
| name | the entity name, without & and ; (borrowed) |
(some s) with a fresh owned String of the character(s) in UTF-8, or (none) when name is not an entity.
(markdown/entity-lookup (string/from-cstr "amp")) ; => (some "&")
Since: markdown-library-plan U2