decode.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. import { fromCodePoint, replaceCodePoint } from "./decode-codepoint.js";
  2. import { htmlDecodeTree } from "./generated/decode-data-html.js";
  3. import { xmlDecodeTree } from "./generated/decode-data-xml.js";
  4. import { BinTrieFlags } from "./internal/bin-trie-flags.js";
  5. var CharCodes;
  6. (function (CharCodes) {
  7. CharCodes[CharCodes["NUM"] = 35] = "NUM";
  8. CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
  9. CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
  10. CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
  11. CharCodes[CharCodes["NINE"] = 57] = "NINE";
  12. CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
  13. CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
  14. CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
  15. CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
  16. CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
  17. CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
  18. CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
  19. })(CharCodes || (CharCodes = {}));
  20. /** Bit that needs to be set to convert an upper case ASCII character to lower case */
  21. const TO_LOWER_BIT = 32;
  22. function isNumber(code) {
  23. return code >= CharCodes.ZERO && code <= CharCodes.NINE;
  24. }
  25. function isHexadecimalCharacter(code) {
  26. return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||
  27. (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));
  28. }
  29. function isAsciiAlphaNumeric(code) {
  30. return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||
  31. (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||
  32. isNumber(code));
  33. }
  34. /**
  35. * Checks if the given character is a valid end character for an entity in an attribute.
  36. *
  37. * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
  38. * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
  39. */
  40. function isEntityInAttributeInvalidEnd(code) {
  41. return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
  42. }
  43. var EntityDecoderState;
  44. (function (EntityDecoderState) {
  45. EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
  46. EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
  47. EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
  48. EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
  49. EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
  50. })(EntityDecoderState || (EntityDecoderState = {}));
  51. export var DecodingMode;
  52. (function (DecodingMode) {
  53. /** Entities in text nodes that can end with any character. */
  54. DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
  55. /** Only allow entities terminated with a semicolon. */
  56. DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
  57. /** Entities in attributes have limitations on ending characters. */
  58. DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
  59. })(DecodingMode || (DecodingMode = {}));
  60. /**
  61. * Token decoder with support of writing partial entities.
  62. */
  63. export class EntityDecoder {
  64. constructor(
  65. /** The tree used to decode entities. */
  66. // biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive
  67. decodeTree,
  68. /**
  69. * The function that is called when a codepoint is decoded.
  70. *
  71. * For multi-byte named entities, this will be called multiple times,
  72. * with the second codepoint, and the same `consumed` value.
  73. *
  74. * @param codepoint The decoded codepoint.
  75. * @param consumed The number of bytes consumed by the decoder.
  76. */
  77. emitCodePoint,
  78. /** An object that is used to produce errors. */
  79. errors) {
  80. this.decodeTree = decodeTree;
  81. this.emitCodePoint = emitCodePoint;
  82. this.errors = errors;
  83. /** The current state of the decoder. */
  84. this.state = EntityDecoderState.EntityStart;
  85. /** Characters that were consumed while parsing an entity. */
  86. this.consumed = 1;
  87. /**
  88. * The result of the entity.
  89. *
  90. * Either the result index of a numeric entity, or the codepoint of a
  91. * numeric entity.
  92. */
  93. this.result = 0;
  94. /** The current index in the decode tree. */
  95. this.treeIndex = 0;
  96. /** The number of characters that were consumed in excess. */
  97. this.excess = 1;
  98. /** The mode in which the decoder is operating. */
  99. this.decodeMode = DecodingMode.Strict;
  100. /** The number of characters that have been consumed in the current run. */
  101. this.runConsumed = 0;
  102. }
  103. /** Resets the instance to make it reusable. */
  104. startEntity(decodeMode) {
  105. this.decodeMode = decodeMode;
  106. this.state = EntityDecoderState.EntityStart;
  107. this.result = 0;
  108. this.treeIndex = 0;
  109. this.excess = 1;
  110. this.consumed = 1;
  111. this.runConsumed = 0;
  112. }
  113. /**
  114. * Write an entity to the decoder. This can be called multiple times with partial entities.
  115. * If the entity is incomplete, the decoder will return -1.
  116. *
  117. * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
  118. * entity is incomplete, and resume when the next string is written.
  119. *
  120. * @param input The string containing the entity (or a continuation of the entity).
  121. * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
  122. * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
  123. */
  124. write(input, offset) {
  125. switch (this.state) {
  126. case EntityDecoderState.EntityStart: {
  127. if (input.charCodeAt(offset) === CharCodes.NUM) {
  128. this.state = EntityDecoderState.NumericStart;
  129. this.consumed += 1;
  130. return this.stateNumericStart(input, offset + 1);
  131. }
  132. this.state = EntityDecoderState.NamedEntity;
  133. return this.stateNamedEntity(input, offset);
  134. }
  135. case EntityDecoderState.NumericStart: {
  136. return this.stateNumericStart(input, offset);
  137. }
  138. case EntityDecoderState.NumericDecimal: {
  139. return this.stateNumericDecimal(input, offset);
  140. }
  141. case EntityDecoderState.NumericHex: {
  142. return this.stateNumericHex(input, offset);
  143. }
  144. case EntityDecoderState.NamedEntity: {
  145. return this.stateNamedEntity(input, offset);
  146. }
  147. }
  148. }
  149. /**
  150. * Switches between the numeric decimal and hexadecimal states.
  151. *
  152. * Equivalent to the `Numeric character reference state` in the HTML spec.
  153. *
  154. * @param input The string containing the entity (or a continuation of the entity).
  155. * @param offset The current offset.
  156. * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
  157. */
  158. stateNumericStart(input, offset) {
  159. if (offset >= input.length) {
  160. return -1;
  161. }
  162. if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
  163. this.state = EntityDecoderState.NumericHex;
  164. this.consumed += 1;
  165. return this.stateNumericHex(input, offset + 1);
  166. }
  167. this.state = EntityDecoderState.NumericDecimal;
  168. return this.stateNumericDecimal(input, offset);
  169. }
  170. /**
  171. * Parses a hexadecimal numeric entity.
  172. *
  173. * Equivalent to the `Hexademical character reference state` in the HTML spec.
  174. *
  175. * @param input The string containing the entity (or a continuation of the entity).
  176. * @param offset The current offset.
  177. * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
  178. */
  179. stateNumericHex(input, offset) {
  180. while (offset < input.length) {
  181. const char = input.charCodeAt(offset);
  182. if (isNumber(char) || isHexadecimalCharacter(char)) {
  183. // Convert hex digit to value (0-15); 'a'/'A' -> 10.
  184. const digit = char <= CharCodes.NINE
  185. ? char - CharCodes.ZERO
  186. : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
  187. this.result = this.result * 16 + digit;
  188. this.consumed++;
  189. offset++;
  190. }
  191. else {
  192. return this.emitNumericEntity(char, 3);
  193. }
  194. }
  195. return -1; // Incomplete entity
  196. }
  197. /**
  198. * Parses a decimal numeric entity.
  199. *
  200. * Equivalent to the `Decimal character reference state` in the HTML spec.
  201. *
  202. * @param input The string containing the entity (or a continuation of the entity).
  203. * @param offset The current offset.
  204. * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
  205. */
  206. stateNumericDecimal(input, offset) {
  207. while (offset < input.length) {
  208. const char = input.charCodeAt(offset);
  209. if (isNumber(char)) {
  210. this.result = this.result * 10 + (char - CharCodes.ZERO);
  211. this.consumed++;
  212. offset++;
  213. }
  214. else {
  215. return this.emitNumericEntity(char, 2);
  216. }
  217. }
  218. return -1; // Incomplete entity
  219. }
  220. /**
  221. * Validate and emit a numeric entity.
  222. *
  223. * Implements the logic from the `Hexademical character reference start
  224. * state` and `Numeric character reference end state` in the HTML spec.
  225. *
  226. * @param lastCp The last code point of the entity. Used to see if the
  227. * entity was terminated with a semicolon.
  228. * @param expectedLength The minimum number of characters that should be
  229. * consumed. Used to validate that at least one digit
  230. * was consumed.
  231. * @returns The number of characters that were consumed.
  232. */
  233. emitNumericEntity(lastCp, expectedLength) {
  234. var _a;
  235. // Ensure we consumed at least one digit.
  236. if (this.consumed <= expectedLength) {
  237. (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
  238. return 0;
  239. }
  240. // Figure out if this is a legit end of the entity
  241. if (lastCp === CharCodes.SEMI) {
  242. this.consumed += 1;
  243. }
  244. else if (this.decodeMode === DecodingMode.Strict) {
  245. return 0;
  246. }
  247. this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
  248. if (this.errors) {
  249. if (lastCp !== CharCodes.SEMI) {
  250. this.errors.missingSemicolonAfterCharacterReference();
  251. }
  252. this.errors.validateNumericCharacterReference(this.result);
  253. }
  254. return this.consumed;
  255. }
  256. /**
  257. * Parses a named entity.
  258. *
  259. * Equivalent to the `Named character reference state` in the HTML spec.
  260. *
  261. * @param input The string containing the entity (or a continuation of the entity).
  262. * @param offset The current offset.
  263. * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
  264. */
  265. stateNamedEntity(input, offset) {
  266. const { decodeTree } = this;
  267. let current = decodeTree[this.treeIndex];
  268. // The length is the number of bytes of the value, including the current byte.
  269. let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
  270. while (offset < input.length) {
  271. // Handle compact runs (possibly inline): valueLength == 0 and SEMI_REQUIRED bit set.
  272. if (valueLength === 0 && (current & BinTrieFlags.FLAG13) !== 0) {
  273. const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; /* 2..63 */
  274. // If we are starting a run, check the first char.
  275. if (this.runConsumed === 0) {
  276. const firstChar = current & BinTrieFlags.JUMP_TABLE;
  277. if (input.charCodeAt(offset) !== firstChar) {
  278. return this.result === 0
  279. ? 0
  280. : this.emitNotTerminatedNamedEntity();
  281. }
  282. offset++;
  283. this.excess++;
  284. this.runConsumed++;
  285. }
  286. // Check remaining characters in the run.
  287. while (this.runConsumed < runLength) {
  288. if (offset >= input.length) {
  289. return -1;
  290. }
  291. const charIndexInPacked = this.runConsumed - 1;
  292. const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
  293. const expectedChar = charIndexInPacked % 2 === 0
  294. ? packedWord & 0xff
  295. : (packedWord >> 8) & 0xff;
  296. if (input.charCodeAt(offset) !== expectedChar) {
  297. this.runConsumed = 0;
  298. return this.result === 0
  299. ? 0
  300. : this.emitNotTerminatedNamedEntity();
  301. }
  302. offset++;
  303. this.excess++;
  304. this.runConsumed++;
  305. }
  306. this.runConsumed = 0;
  307. this.treeIndex += 1 + (runLength >> 1);
  308. current = decodeTree[this.treeIndex];
  309. valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
  310. }
  311. if (offset >= input.length)
  312. break;
  313. const char = input.charCodeAt(offset);
  314. /*
  315. * Implicit semicolon handling for nodes that require a semicolon but
  316. * don't have an explicit ';' branch stored in the trie. If we have
  317. * a value on the current node, it requires a semicolon, and the
  318. * current input character is a semicolon, emit the entity using the
  319. * current node (without descending further).
  320. */
  321. if (char === CharCodes.SEMI &&
  322. valueLength !== 0 &&
  323. (current & BinTrieFlags.FLAG13) !== 0) {
  324. return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
  325. }
  326. this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
  327. if (this.treeIndex < 0) {
  328. return this.result === 0 ||
  329. // If we are parsing an attribute
  330. (this.decodeMode === DecodingMode.Attribute &&
  331. // We shouldn't have consumed any characters after the entity,
  332. (valueLength === 0 ||
  333. // And there should be no invalid characters.
  334. isEntityInAttributeInvalidEnd(char)))
  335. ? 0
  336. : this.emitNotTerminatedNamedEntity();
  337. }
  338. current = decodeTree[this.treeIndex];
  339. valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
  340. // If the branch is a value, store it and continue
  341. if (valueLength !== 0) {
  342. // If the entity is terminated by a semicolon, we are done.
  343. if (char === CharCodes.SEMI) {
  344. return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
  345. }
  346. // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.
  347. if (this.decodeMode !== DecodingMode.Strict &&
  348. (current & BinTrieFlags.FLAG13) === 0) {
  349. this.result = this.treeIndex;
  350. this.consumed += this.excess;
  351. this.excess = 0;
  352. }
  353. }
  354. // Increment offset & excess for next iteration
  355. offset++;
  356. this.excess++;
  357. }
  358. return -1;
  359. }
  360. /**
  361. * Emit a named entity that was not terminated with a semicolon.
  362. *
  363. * @returns The number of characters consumed.
  364. */
  365. emitNotTerminatedNamedEntity() {
  366. var _a;
  367. const { result, decodeTree } = this;
  368. const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
  369. this.emitNamedEntityData(result, valueLength, this.consumed);
  370. (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
  371. return this.consumed;
  372. }
  373. /**
  374. * Emit a named entity.
  375. *
  376. * @param result The index of the entity in the decode tree.
  377. * @param valueLength The number of bytes in the entity.
  378. * @param consumed The number of characters consumed.
  379. *
  380. * @returns The number of characters consumed.
  381. */
  382. emitNamedEntityData(result, valueLength, consumed) {
  383. const { decodeTree } = this;
  384. this.emitCodePoint(valueLength === 1
  385. ? decodeTree[result] &
  386. ~(BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)
  387. : decodeTree[result + 1], consumed);
  388. if (valueLength === 3) {
  389. // For multi-byte values, we need to emit the second byte.
  390. this.emitCodePoint(decodeTree[result + 2], consumed);
  391. }
  392. return consumed;
  393. }
  394. /**
  395. * Signal to the parser that the end of the input was reached.
  396. *
  397. * Remaining data will be emitted and relevant errors will be produced.
  398. *
  399. * @returns The number of characters consumed.
  400. */
  401. end() {
  402. var _a;
  403. switch (this.state) {
  404. case EntityDecoderState.NamedEntity: {
  405. // Emit a named entity if we have one.
  406. return this.result !== 0 &&
  407. (this.decodeMode !== DecodingMode.Attribute ||
  408. this.result === this.treeIndex)
  409. ? this.emitNotTerminatedNamedEntity()
  410. : 0;
  411. }
  412. // Otherwise, emit a numeric entity if we have one.
  413. case EntityDecoderState.NumericDecimal: {
  414. return this.emitNumericEntity(0, 2);
  415. }
  416. case EntityDecoderState.NumericHex: {
  417. return this.emitNumericEntity(0, 3);
  418. }
  419. case EntityDecoderState.NumericStart: {
  420. (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
  421. return 0;
  422. }
  423. case EntityDecoderState.EntityStart: {
  424. // Return 0 if we have no entity.
  425. return 0;
  426. }
  427. }
  428. }
  429. }
  430. /**
  431. * Creates a function that decodes entities in a string.
  432. *
  433. * @param decodeTree The decode tree.
  434. * @returns A function that decodes entities in a string.
  435. */
  436. function getDecoder(decodeTree) {
  437. let returnValue = "";
  438. const decoder = new EntityDecoder(decodeTree, (data) => (returnValue += fromCodePoint(data)));
  439. return function decodeWithTrie(input, decodeMode) {
  440. let lastIndex = 0;
  441. let offset = 0;
  442. while ((offset = input.indexOf("&", offset)) >= 0) {
  443. returnValue += input.slice(lastIndex, offset);
  444. decoder.startEntity(decodeMode);
  445. const length = decoder.write(input,
  446. // Skip the "&"
  447. offset + 1);
  448. if (length < 0) {
  449. lastIndex = offset + decoder.end();
  450. break;
  451. }
  452. lastIndex = offset + length;
  453. // If `length` is 0, skip the current `&` and continue.
  454. offset = length === 0 ? lastIndex + 1 : lastIndex;
  455. }
  456. const result = returnValue + input.slice(lastIndex);
  457. // Make sure we don't keep a reference to the final string.
  458. returnValue = "";
  459. return result;
  460. };
  461. }
  462. /**
  463. * Determines the branch of the current node that is taken given the current
  464. * character. This function is used to traverse the trie.
  465. *
  466. * @param decodeTree The trie.
  467. * @param current The current node.
  468. * @param nodeIdx The index right after the current node and its value.
  469. * @param char The current character.
  470. * @returns The index of the next node, or -1 if no branch is taken.
  471. */
  472. export function determineBranch(decodeTree, current, nodeIndex, char) {
  473. const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
  474. const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
  475. // Case 1: Single branch encoded in jump offset
  476. if (branchCount === 0) {
  477. return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
  478. }
  479. // Case 2: Multiple branches encoded in jump table
  480. if (jumpOffset) {
  481. const value = char - jumpOffset;
  482. return value < 0 || value >= branchCount
  483. ? -1
  484. : decodeTree[nodeIndex + value] - 1;
  485. }
  486. // Case 3: Multiple branches encoded in packed dictionary (two keys per uint16)
  487. const packedKeySlots = (branchCount + 1) >> 1;
  488. /*
  489. * Treat packed keys as a virtual sorted array of length `branchCount`.
  490. * Key(i) = low byte for even i, high byte for odd i in slot i>>1.
  491. */
  492. let lo = 0;
  493. let hi = branchCount - 1;
  494. while (lo <= hi) {
  495. const mid = (lo + hi) >>> 1;
  496. const slot = mid >> 1;
  497. const packed = decodeTree[nodeIndex + slot];
  498. const midKey = (packed >> ((mid & 1) * 8)) & 0xff;
  499. if (midKey < char) {
  500. lo = mid + 1;
  501. }
  502. else if (midKey > char) {
  503. hi = mid - 1;
  504. }
  505. else {
  506. return decodeTree[nodeIndex + packedKeySlots + mid];
  507. }
  508. }
  509. return -1;
  510. }
  511. const htmlDecoder = /* #__PURE__ */ getDecoder(htmlDecodeTree);
  512. const xmlDecoder = /* #__PURE__ */ getDecoder(xmlDecodeTree);
  513. /**
  514. * Decodes an HTML string.
  515. *
  516. * @param htmlString The string to decode.
  517. * @param mode The decoding mode.
  518. * @returns The decoded string.
  519. */
  520. export function decodeHTML(htmlString, mode = DecodingMode.Legacy) {
  521. return htmlDecoder(htmlString, mode);
  522. }
  523. /**
  524. * Decodes an HTML string in an attribute.
  525. *
  526. * @param htmlAttribute The string to decode.
  527. * @returns The decoded string.
  528. */
  529. export function decodeHTMLAttribute(htmlAttribute) {
  530. return htmlDecoder(htmlAttribute, DecodingMode.Attribute);
  531. }
  532. /**
  533. * Decodes an HTML string, requiring all entities to be terminated by a semicolon.
  534. *
  535. * @param htmlString The string to decode.
  536. * @returns The decoded string.
  537. */
  538. export function decodeHTMLStrict(htmlString) {
  539. return htmlDecoder(htmlString, DecodingMode.Strict);
  540. }
  541. /**
  542. * Decodes an XML string, requiring all entities to be terminated by a semicolon.
  543. *
  544. * @param xmlString The string to decode.
  545. * @returns The decoded string.
  546. */
  547. export function decodeXML(xmlString) {
  548. return xmlDecoder(xmlString, DecodingMode.Strict);
  549. }
  550. export { decodeCodePoint, fromCodePoint, replaceCodePoint, } from "./decode-codepoint.js";
  551. // Re-export for use by eg. htmlparser2
  552. export { htmlDecodeTree } from "./generated/decode-data-html.js";
  553. export { xmlDecodeTree } from "./generated/decode-data-xml.js";
  554. //# sourceMappingURL=decode.js.map