/** * @fileoverview Character-reference decoding for deposited Crossref text — the HTML5 named * set plus numeric and hex references. * * The table is the WHATWG named-character-reference set — 2,125 semicolon-terminated names, * packed as space-separated `name=characters` pairs. Regenerate from the spec's own data * file, which is the normative list: https://html.spec.whatwg.org/entities.json * * The legacy forms that parse without a trailing semicolon (`©`, `×`, `¬`) are * deliberately out. In deposited citation text an unterminated `&` is an ampersand somebody * typed far more often than the head of a reference — `Nuc. Sci. &Eng 2013` is a journal * abbreviation, not an entity — so requiring the semicolon is what keeps a bare `&` bare. * A terminated reference whose name is not in the table (`&Amp;`, `&Eng;`) is left exactly * as deposited for the same reason. * @module services/crossref/html-entities */ /** * Decode every character reference in a deposited string. An unrecognized or malformed * reference is passed through as its source text. * * One pass over the input, which is what keeps a reference from being resolved twice: * `&lt;` is the escaped text `<` and decodes to exactly that, never to `<`. A chain * of per-entity replaces decodes it twice and manufactures markup out of text a publisher * escaped precisely so it would not be markup. * * Callers strip markup before decoding, never after — see the normalization passes in * `crossref-service`. A deposited `<i>` has to reach the strip still escaped, or it * decodes into a tag the strip then eats and the reader loses the text. */ export declare function decodeHtmlEntities(raw: string): string; //# sourceMappingURL=html-entities.d.ts.map