You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0e6501a
Browse filesBrowse the repository at this point in the historyBrowse files
* @property {string=} fragmentContext context element name for fragment parsing (e.g. `td`, `svg path`); omit for a full document
5396
+
* @property {boolean=} xml parse as XML instead of applying the HTML tree-construction rules
5393
5397
* @property {HtmlAstSkip=} skip node kinds to omit from the AST (see `HtmlAstSkip`); omit to build the full tree
5394
5398
* @property {boolean=} scripting parse as a browser with scripting on does, where a `noscript` holds raw text; off by default, so what it holds is read as markup
5395
5399
*/
@@ -5685,6 +5689,7 @@ let inputHasNul = true;
5685
5689
let skipText = false;
5686
5690
let skipComments = false;
5687
5691
let skipDoctype = false;
5692
+
let xmlMode = false;
5688
5693
/** @type {HtmlNodeRef} */
5689
5694
let doc = 0;
5690
5695
let mode = 0;
@@ -6362,6 +6367,50 @@ const process = (t) => {
6362
6367
runMode(t);
6363
6368
};
6364
6369
6370
+
/**
6371
+
* XML has no insertion modes: elements are appended to the current element
6372
+
* and an end tag closes the element with the same case-sensitive name.
6373
+
* @param {Token} t token to process
6374
+
* @returns {void}
6375
+
*/
6376
+
const processXml = (t) => {
6377
+
const ty = t.type;
6378
+
if (ty === TOKEN_START_TAG || ty === TOKEN_END_TAG) tokenEnd = t.pos.end;
* @property {string=} fragmentContext context element tag name for fragment parsing (see `parseHtml`); the HTML analog of the CSS parser's `as` parse-mode option
112
+
* @property {boolean=} xml parse as XML instead of applying the HTML tree-construction rules
112
113
* @property {HtmlAstSkip=} skip node kinds to omit from the AST for speed/memory (see `HtmlAstSkip`)
113
114
* @property {boolean=} minimize print the safely-minified serialization (nodes rebuilt from source, inert comments dropped, opening-tag whitespace collapsed) as `process` walks, and return it (default false = walk only, return `""`)
114
115
* @property {HtmlTransformOptions=} transforms which of the meaning-preserving rewrites the minifying print makes; each is on unless it is `false`
0 commit comments