parse5 7.2.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/parser/formatting-element-list.js +4 -4
  2. package/dist/parser/index.d.ts +1 -1
  3. package/dist/parser/index.js +13 -8
  4. package/dist/parser/open-element-stack.d.ts +2 -2
  5. package/dist/parser/open-element-stack.js +11 -7
  6. package/dist/serializer/index.js +1 -1
  7. package/dist/tokenizer/index.d.ts +1 -1
  8. package/dist/tokenizer/index.js +1 -1
  9. package/package.json +7 -9
  10. package/dist/cjs/common/doctype.d.ts +0 -4
  11. package/dist/cjs/common/doctype.js +0 -118
  12. package/dist/cjs/common/error-codes.d.ts +0 -67
  13. package/dist/cjs/common/error-codes.js +0 -66
  14. package/dist/cjs/common/foreign-content.d.ts +0 -9
  15. package/dist/cjs/common/foreign-content.js +0 -237
  16. package/dist/cjs/common/html.d.ts +0 -289
  17. package/dist/cjs/common/html.js +0 -528
  18. package/dist/cjs/common/token.d.ts +0 -84
  19. package/dist/cjs/common/token.js +0 -24
  20. package/dist/cjs/common/unicode.d.ts +0 -42
  21. package/dist/cjs/common/unicode.js +0 -70
  22. package/dist/cjs/index.d.ts +0 -71
  23. package/dist/cjs/index.js +0 -54
  24. package/dist/cjs/package.json +0 -1
  25. package/dist/cjs/parser/formatting-element-list.d.ts +0 -36
  26. package/dist/cjs/parser/formatting-element-list.js +0 -114
  27. package/dist/cjs/parser/index.d.ts +0 -221
  28. package/dist/cjs/parser/index.js +0 -3235
  29. package/dist/cjs/parser/open-element-stack.d.ts +0 -53
  30. package/dist/cjs/parser/open-element-stack.js +0 -324
  31. package/dist/cjs/serializer/index.d.ts +0 -60
  32. package/dist/cjs/serializer/index.js +0 -172
  33. package/dist/cjs/tokenizer/index.d.ts +0 -247
  34. package/dist/cjs/tokenizer/index.js +0 -2714
  35. package/dist/cjs/tokenizer/preprocessor.d.ts +0 -36
  36. package/dist/cjs/tokenizer/preprocessor.js +0 -200
  37. package/dist/cjs/tree-adapters/default.d.ts +0 -84
  38. package/dist/cjs/tree-adapters/default.js +0 -176
  39. package/dist/cjs/tree-adapters/interface.d.ts +0 -255
  40. package/dist/cjs/tree-adapters/interface.js +0 -2
@@ -81,7 +81,7 @@ export class FormattingElementList {
81
81
  }
82
82
  removeEntry(entry) {
83
83
  const entryIndex = this.entries.indexOf(entry);
84
- if (entryIndex >= 0) {
84
+ if (entryIndex !== -1) {
85
85
  this.entries.splice(entryIndex, 1);
86
86
  }
87
87
  }
@@ -92,11 +92,11 @@ export class FormattingElementList {
92
92
  */
93
93
  clearToLastMarker() {
94
94
  const markerIdx = this.entries.indexOf(MARKER);
95
- if (markerIdx >= 0) {
96
- this.entries.splice(0, markerIdx + 1);
95
+ if (markerIdx === -1) {
96
+ this.entries.length = 0;
97
97
  }
98
98
  else {
99
- this.entries.length = 0;
99
+ this.entries.splice(0, markerIdx + 1);
100
100
  }
101
101
  }
102
102
  //Search
@@ -122,7 +122,7 @@ export declare class Parser<T extends TreeAdapterTypeMap> implements TokenHandle
122
122
  onItemPush(node: T['parentNode'], tid: number, isTop: boolean): void;
123
123
  /** @internal */
124
124
  onItemPop(node: T['parentNode'], isTop: boolean): void;
125
- protected _setContextModes(current: T['parentNode'], tid: number): void;
125
+ protected _setContextModes(current: T['parentNode'] | undefined, tid: number | undefined): void;
126
126
  /** @protected */
127
127
  _switchToTextParsing(currentToken: TagToken, nextTokenizerState: (typeof TokenizerMode)[keyof typeof TokenizerMode]): void;
128
128
  switchToPlaintextParsing(): void;
@@ -191,9 +191,10 @@ export class Parser {
191
191
  }
192
192
  }
193
193
  _setContextModes(current, tid) {
194
- const isHTML = current === this.document || this.treeAdapter.getNamespaceURI(current) === NS.HTML;
194
+ const isHTML = current === this.document || (current && this.treeAdapter.getNamespaceURI(current) === NS.HTML);
195
195
  this.currentNotInHTML = !isHTML;
196
- this.tokenizer.inForeignNode = !isHTML && !this._isIntegrationPoint(tid, current);
196
+ this.tokenizer.inForeignNode =
197
+ !isHTML && current !== undefined && tid !== undefined && !this._isIntegrationPoint(tid, current);
197
198
  }
198
199
  /** @protected */
199
200
  _switchToTextParsing(currentToken, nextTokenizerState) {
@@ -285,7 +286,7 @@ export class Parser {
285
286
  }
286
287
  else {
287
288
  const parent = this.openElements.currentTmplContentOrNode;
288
- this.treeAdapter.appendChild(parent, element);
289
+ this.treeAdapter.appendChild(parent !== null && parent !== void 0 ? parent : this.document, element);
289
290
  }
290
291
  }
291
292
  /**
@@ -422,6 +423,7 @@ export class Parser {
422
423
  // If it _is_ an integration point, then we might have to check that it is not an HTML
423
424
  // integration point.
424
425
  ((token.tagID === $.MGLYPH || token.tagID === $.MALIGNMARK) &&
426
+ currentTagId !== undefined &&
425
427
  !this._isIntegrationPoint(currentTagId, current, NS.HTML)));
426
428
  }
427
429
  /** @protected */
@@ -474,7 +476,7 @@ export class Parser {
474
476
  const listLength = this.activeFormattingElements.entries.length;
475
477
  if (listLength) {
476
478
  const endIndex = this.activeFormattingElements.entries.findIndex((entry) => entry.type === EntryType.Marker || this.openElements.contains(entry.element));
477
- const unopenIdx = endIndex < 0 ? listLength - 1 : endIndex - 1;
479
+ const unopenIdx = endIndex === -1 ? listLength - 1 : endIndex - 1;
478
480
  for (let i = unopenIdx; i >= 0; i--) {
479
481
  const entry = this.activeFormattingElements.entries[i];
480
482
  this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
@@ -585,7 +587,9 @@ export class Parser {
585
587
  }
586
588
  /** @protected */
587
589
  _shouldFosterParentOnInsertion() {
588
- return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.currentTagId);
590
+ return (this.fosterParentingEnabled &&
591
+ this.openElements.currentTagId !== undefined &&
592
+ this._isElementCausesFosterParenting(this.openElements.currentTagId));
589
593
  }
590
594
  /** @protected */
591
595
  _findFosterParentingLocation() {
@@ -1204,7 +1208,7 @@ function aaObtainFurthestBlock(p, formattingElementEntry) {
1204
1208
  }
1205
1209
  }
1206
1210
  if (!furthestBlock) {
1207
- p.openElements.shortenToLength(idx < 0 ? 0 : idx);
1211
+ p.openElements.shortenToLength(Math.max(idx, 0));
1208
1212
  p.activeFormattingElements.removeEntry(formattingElementEntry);
1209
1213
  }
1210
1214
  return furthestBlock;
@@ -1690,7 +1694,7 @@ function numberedHeaderStartTagInBody(p, token) {
1690
1694
  if (p.openElements.hasInButtonScope($.P)) {
1691
1695
  p._closePElement();
1692
1696
  }
1693
- if (NUMBERED_HEADERS.has(p.openElements.currentTagId)) {
1697
+ if (p.openElements.currentTagId !== undefined && NUMBERED_HEADERS.has(p.openElements.currentTagId)) {
1694
1698
  p.openElements.pop();
1695
1699
  }
1696
1700
  p._insertElement(token, NS.HTML);
@@ -2363,7 +2367,7 @@ function eofInText(p, token) {
2363
2367
  // The "in table" insertion mode
2364
2368
  //------------------------------------------------------------------
2365
2369
  function characterInTable(p, token) {
2366
- if (TABLE_STRUCTURE_TAGS.has(p.openElements.currentTagId)) {
2370
+ if (p.openElements.currentTagId !== undefined && TABLE_STRUCTURE_TAGS.has(p.openElements.currentTagId)) {
2367
2371
  p.pendingCharacterTokens.length = 0;
2368
2372
  p.hasNonWhitespacePendingCharacterToken = false;
2369
2373
  p.originalInsertionMode = p.insertionMode;
@@ -3188,6 +3192,7 @@ function characterInForeignContent(p, token) {
3188
3192
  }
3189
3193
  function popUntilHtmlOrIntegrationPoint(p) {
3190
3194
  while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML &&
3195
+ p.openElements.currentTagId !== undefined &&
3191
3196
  !p._isIntegrationPoint(p.openElements.currentTagId, p.openElements.current)) {
3192
3197
  p.openElements.pop();
3193
3198
  }
@@ -9,10 +9,10 @@ export declare class OpenElementStack<T extends TreeAdapterTypeMap> {
9
9
  private handler;
10
10
  items: T['parentNode'][];
11
11
  tagIDs: $[];
12
- current: T['parentNode'];
12
+ current: T['parentNode'] | undefined;
13
13
  stackTop: number;
14
14
  tmplCount: number;
15
- currentTagId: $;
15
+ currentTagId: number | undefined;
16
16
  get currentTmplContentOrNode(): T['parentNode'];
17
17
  constructor(document: T['document'], treeAdapter: TreeAdapter<T>, handler: StackHandler<T>);
18
18
  private _indexOf;
@@ -94,14 +94,16 @@ export class OpenElementStack {
94
94
  if (insertionIdx === this.stackTop) {
95
95
  this._updateCurrentElement();
96
96
  }
97
- this.handler.onItemPush(this.current, this.currentTagId, insertionIdx === this.stackTop);
97
+ if (this.current && this.currentTagId !== undefined) {
98
+ this.handler.onItemPush(this.current, this.currentTagId, insertionIdx === this.stackTop);
99
+ }
98
100
  }
99
101
  popUntilTagNamePopped(tagName) {
100
102
  let targetIdx = this.stackTop + 1;
101
103
  do {
102
104
  targetIdx = this.tagIDs.lastIndexOf(tagName, targetIdx - 1);
103
105
  } while (targetIdx > 0 && this.treeAdapter.getNamespaceURI(this.items[targetIdx]) !== NS.HTML);
104
- this.shortenToLength(targetIdx < 0 ? 0 : targetIdx);
106
+ this.shortenToLength(Math.max(targetIdx, 0));
105
107
  }
106
108
  shortenToLength(idx) {
107
109
  while (this.stackTop >= idx) {
@@ -116,11 +118,11 @@ export class OpenElementStack {
116
118
  }
117
119
  popUntilElementPopped(element) {
118
120
  const idx = this._indexOf(element);
119
- this.shortenToLength(idx < 0 ? 0 : idx);
121
+ this.shortenToLength(Math.max(idx, 0));
120
122
  }
121
123
  popUntilPopped(tagNames, targetNS) {
122
124
  const idx = this._indexOfTagNames(tagNames, targetNS);
123
- this.shortenToLength(idx < 0 ? 0 : idx);
125
+ this.shortenToLength(Math.max(idx, 0));
124
126
  }
125
127
  popUntilNumberedHeaderPopped() {
126
128
  this.popUntilPopped(NUMBERED_HEADERS, NS.HTML);
@@ -303,17 +305,19 @@ export class OpenElementStack {
303
305
  }
304
306
  //Implied end tags
305
307
  generateImpliedEndTags() {
306
- while (IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId)) {
308
+ while (this.currentTagId !== undefined && IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId)) {
307
309
  this.pop();
308
310
  }
309
311
  }
310
312
  generateImpliedEndTagsThoroughly() {
311
- while (IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {
313
+ while (this.currentTagId !== undefined && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {
312
314
  this.pop();
313
315
  }
314
316
  }
315
317
  generateImpliedEndTagsWithExclusion(exclusionId) {
316
- while (this.currentTagId !== exclusionId && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {
318
+ while (this.currentTagId !== undefined &&
319
+ this.currentTagId !== exclusionId &&
320
+ IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {
317
321
  this.pop();
318
322
  }
319
323
  }
@@ -1,5 +1,5 @@
1
1
  import { TAG_NAMES as $, NS, hasUnescapedText } from '../common/html.js';
2
- import { escapeText, escapeAttribute } from 'entities/lib/escape.js';
2
+ import { escapeText, escapeAttribute } from 'entities/escape';
3
3
  import { defaultTreeAdapter } from '../tree-adapters/default.js';
4
4
  // Sets
5
5
  const VOID_ELEMENTS = new Set([
@@ -1,6 +1,6 @@
1
1
  import { Preprocessor } from './preprocessor.js';
2
2
  import { type Token, type CharacterToken, type DoctypeToken, type TagToken, type EOFToken, type CommentToken, type Attribute, type Location } from '../common/token.js';
3
- import { EntityDecoder } from 'entities/lib/decode.js';
3
+ import { EntityDecoder } from 'entities/decode';
4
4
  import { ERR, type ParserErrorHandler } from '../common/error-codes.js';
5
5
  declare const enum State {
6
6
  DATA = 0,
@@ -1,7 +1,7 @@
1
1
  import { Preprocessor } from './preprocessor.js';
2
2
  import { CODE_POINTS as $, SEQUENCES as $$, REPLACEMENT_CHARACTER, isSurrogate, isUndefinedCodePoint, isControlCodePoint, } from '../common/unicode.js';
3
3
  import { TokenType, getTokenAttr, } from '../common/token.js';
4
- import { htmlDecodeTree, EntityDecoder, DecodingMode } from 'entities/lib/decode.js';
4
+ import { htmlDecodeTree, EntityDecoder, DecodingMode } from 'entities/decode';
5
5
  import { ERR } from '../common/error-codes.js';
6
6
  import { TAG_ID, getTagID } from '../common/html.js';
7
7
  //States
package/package.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "name": "parse5",
3
3
  "type": "module",
4
4
  "description": "HTML parser and serializer.",
5
- "version": "7.2.1",
5
+ "version": "8.0.0",
6
6
  "author": "Ivan Nikulin <ifaaan@gmail.com> (https://github.com/inikulin)",
7
7
  "contributors": "https://github.com/inikulin/parse5/graphs/contributors",
8
8
  "homepage": "https://parse5.js.org",
9
9
  "funding": "https://github.com/inikulin/parse5?sponsor=1",
10
10
  "dependencies": {
11
- "entities": "^4.5.0"
11
+ "entities": "^6.0.0"
12
12
  },
13
13
  "keywords": [
14
14
  "html",
@@ -28,22 +28,20 @@
28
28
  "serialize"
29
29
  ],
30
30
  "license": "MIT",
31
- "main": "dist/cjs/index.js",
31
+ "main": "dist/index.js",
32
32
  "module": "dist/index.js",
33
33
  "types": "dist/index.d.ts",
34
34
  "exports": {
35
- "import": "./dist/index.js",
36
- "require": "./dist/cjs/index.js"
37
- },
38
- "scripts": {
39
- "build:cjs": "tsc --moduleResolution node10 --module CommonJS --target ES6 --outDir dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"
35
+ ".": {
36
+ "default": "./dist/index.js"
37
+ }
40
38
  },
39
+ "scripts": {},
41
40
  "repository": {
42
41
  "type": "git",
43
42
  "url": "git://github.com/inikulin/parse5.git"
44
43
  },
45
44
  "files": [
46
- "dist/cjs/package.json",
47
45
  "dist/**/*.js",
48
46
  "dist/**/*.d.ts"
49
47
  ]
@@ -1,4 +0,0 @@
1
- import { DOCUMENT_MODE } from './html.js';
2
- import type { DoctypeToken } from './token.js';
3
- export declare function isConforming(token: DoctypeToken): boolean;
4
- export declare function getDocumentMode(token: DoctypeToken): DOCUMENT_MODE;
@@ -1,118 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isConforming = isConforming;
4
- exports.getDocumentMode = getDocumentMode;
5
- const html_js_1 = require("./html.js");
6
- //Const
7
- const VALID_DOCTYPE_NAME = 'html';
8
- const VALID_SYSTEM_ID = 'about:legacy-compat';
9
- const QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd';
10
- const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
11
- '+//silmaril//dtd html pro v0r11 19970101//',
12
- '-//as//dtd html 3.0 aswedit + extensions//',
13
- '-//advasoft ltd//dtd html 3.0 aswedit + extensions//',
14
- '-//ietf//dtd html 2.0 level 1//',
15
- '-//ietf//dtd html 2.0 level 2//',
16
- '-//ietf//dtd html 2.0 strict level 1//',
17
- '-//ietf//dtd html 2.0 strict level 2//',
18
- '-//ietf//dtd html 2.0 strict//',
19
- '-//ietf//dtd html 2.0//',
20
- '-//ietf//dtd html 2.1e//',
21
- '-//ietf//dtd html 3.0//',
22
- '-//ietf//dtd html 3.2 final//',
23
- '-//ietf//dtd html 3.2//',
24
- '-//ietf//dtd html 3//',
25
- '-//ietf//dtd html level 0//',
26
- '-//ietf//dtd html level 1//',
27
- '-//ietf//dtd html level 2//',
28
- '-//ietf//dtd html level 3//',
29
- '-//ietf//dtd html strict level 0//',
30
- '-//ietf//dtd html strict level 1//',
31
- '-//ietf//dtd html strict level 2//',
32
- '-//ietf//dtd html strict level 3//',
33
- '-//ietf//dtd html strict//',
34
- '-//ietf//dtd html//',
35
- '-//metrius//dtd metrius presentational//',
36
- '-//microsoft//dtd internet explorer 2.0 html strict//',
37
- '-//microsoft//dtd internet explorer 2.0 html//',
38
- '-//microsoft//dtd internet explorer 2.0 tables//',
39
- '-//microsoft//dtd internet explorer 3.0 html strict//',
40
- '-//microsoft//dtd internet explorer 3.0 html//',
41
- '-//microsoft//dtd internet explorer 3.0 tables//',
42
- '-//netscape comm. corp.//dtd html//',
43
- '-//netscape comm. corp.//dtd strict html//',
44
- "-//o'reilly and associates//dtd html 2.0//",
45
- "-//o'reilly and associates//dtd html extended 1.0//",
46
- "-//o'reilly and associates//dtd html extended relaxed 1.0//",
47
- '-//sq//dtd html 2.0 hotmetal + extensions//',
48
- '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//',
49
- '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//',
50
- '-//spyglass//dtd html 2.0 extended//',
51
- '-//sun microsystems corp.//dtd hotjava html//',
52
- '-//sun microsystems corp.//dtd hotjava strict html//',
53
- '-//w3c//dtd html 3 1995-03-24//',
54
- '-//w3c//dtd html 3.2 draft//',
55
- '-//w3c//dtd html 3.2 final//',
56
- '-//w3c//dtd html 3.2//',
57
- '-//w3c//dtd html 3.2s draft//',
58
- '-//w3c//dtd html 4.0 frameset//',
59
- '-//w3c//dtd html 4.0 transitional//',
60
- '-//w3c//dtd html experimental 19960712//',
61
- '-//w3c//dtd html experimental 970421//',
62
- '-//w3c//dtd w3 html//',
63
- '-//w3o//dtd w3 html 3.0//',
64
- '-//webtechs//dtd mozilla html 2.0//',
65
- '-//webtechs//dtd mozilla html//',
66
- ];
67
- const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
68
- ...QUIRKS_MODE_PUBLIC_ID_PREFIXES,
69
- '-//w3c//dtd html 4.01 frameset//',
70
- '-//w3c//dtd html 4.01 transitional//',
71
- ];
72
- const QUIRKS_MODE_PUBLIC_IDS = new Set([
73
- '-//w3o//dtd w3 html strict 3.0//en//',
74
- '-/w3c/dtd html 4.0 transitional/en',
75
- 'html',
76
- ]);
77
- const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//'];
78
- const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
79
- ...LIMITED_QUIRKS_PUBLIC_ID_PREFIXES,
80
- '-//w3c//dtd html 4.01 frameset//',
81
- '-//w3c//dtd html 4.01 transitional//',
82
- ];
83
- //Utils
84
- function hasPrefix(publicId, prefixes) {
85
- return prefixes.some((prefix) => publicId.startsWith(prefix));
86
- }
87
- //API
88
- function isConforming(token) {
89
- return (token.name === VALID_DOCTYPE_NAME &&
90
- token.publicId === null &&
91
- (token.systemId === null || token.systemId === VALID_SYSTEM_ID));
92
- }
93
- function getDocumentMode(token) {
94
- if (token.name !== VALID_DOCTYPE_NAME) {
95
- return html_js_1.DOCUMENT_MODE.QUIRKS;
96
- }
97
- const { systemId } = token;
98
- if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {
99
- return html_js_1.DOCUMENT_MODE.QUIRKS;
100
- }
101
- let { publicId } = token;
102
- if (publicId !== null) {
103
- publicId = publicId.toLowerCase();
104
- if (QUIRKS_MODE_PUBLIC_IDS.has(publicId)) {
105
- return html_js_1.DOCUMENT_MODE.QUIRKS;
106
- }
107
- let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
108
- if (hasPrefix(publicId, prefixes)) {
109
- return html_js_1.DOCUMENT_MODE.QUIRKS;
110
- }
111
- prefixes =
112
- systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
113
- if (hasPrefix(publicId, prefixes)) {
114
- return html_js_1.DOCUMENT_MODE.LIMITED_QUIRKS;
115
- }
116
- }
117
- return html_js_1.DOCUMENT_MODE.NO_QUIRKS;
118
- }
@@ -1,67 +0,0 @@
1
- import type { Location } from './token.js';
2
- export interface ParserError extends Location {
3
- code: ERR;
4
- }
5
- export type ParserErrorHandler = (error: ParserError) => void;
6
- export declare enum ERR {
7
- controlCharacterInInputStream = "control-character-in-input-stream",
8
- noncharacterInInputStream = "noncharacter-in-input-stream",
9
- surrogateInInputStream = "surrogate-in-input-stream",
10
- nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus",
11
- endTagWithAttributes = "end-tag-with-attributes",
12
- endTagWithTrailingSolidus = "end-tag-with-trailing-solidus",
13
- unexpectedSolidusInTag = "unexpected-solidus-in-tag",
14
- unexpectedNullCharacter = "unexpected-null-character",
15
- unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name",
16
- invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name",
17
- unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name",
18
- missingEndTagName = "missing-end-tag-name",
19
- unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name",
20
- unknownNamedCharacterReference = "unknown-named-character-reference",
21
- missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference",
22
- unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier",
23
- unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value",
24
- eofBeforeTagName = "eof-before-tag-name",
25
- eofInTag = "eof-in-tag",
26
- missingAttributeValue = "missing-attribute-value",
27
- missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes",
28
- missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword",
29
- missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers",
30
- missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword",
31
- missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier",
32
- missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier",
33
- missingDoctypePublicIdentifier = "missing-doctype-public-identifier",
34
- missingDoctypeSystemIdentifier = "missing-doctype-system-identifier",
35
- abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier",
36
- abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier",
37
- cdataInHtmlContent = "cdata-in-html-content",
38
- incorrectlyOpenedComment = "incorrectly-opened-comment",
39
- eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text",
40
- eofInDoctype = "eof-in-doctype",
41
- nestedComment = "nested-comment",
42
- abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment",
43
- eofInComment = "eof-in-comment",
44
- incorrectlyClosedComment = "incorrectly-closed-comment",
45
- eofInCdata = "eof-in-cdata",
46
- absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference",
47
- nullCharacterReference = "null-character-reference",
48
- surrogateCharacterReference = "surrogate-character-reference",
49
- characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range",
50
- controlCharacterReference = "control-character-reference",
51
- noncharacterCharacterReference = "noncharacter-character-reference",
52
- missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name",
53
- missingDoctypeName = "missing-doctype-name",
54
- invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name",
55
- duplicateAttribute = "duplicate-attribute",
56
- nonConformingDoctype = "non-conforming-doctype",
57
- missingDoctype = "missing-doctype",
58
- misplacedDoctype = "misplaced-doctype",
59
- endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element",
60
- closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements",
61
- disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head",
62
- openElementsLeftAfterEof = "open-elements-left-after-eof",
63
- abandonedHeadElementChild = "abandoned-head-element-child",
64
- misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element",
65
- nestedNoscriptInHead = "nested-noscript-in-head",
66
- eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text"
67
- }
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ERR = void 0;
4
- var ERR;
5
- (function (ERR) {
6
- ERR["controlCharacterInInputStream"] = "control-character-in-input-stream";
7
- ERR["noncharacterInInputStream"] = "noncharacter-in-input-stream";
8
- ERR["surrogateInInputStream"] = "surrogate-in-input-stream";
9
- ERR["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus";
10
- ERR["endTagWithAttributes"] = "end-tag-with-attributes";
11
- ERR["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus";
12
- ERR["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag";
13
- ERR["unexpectedNullCharacter"] = "unexpected-null-character";
14
- ERR["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name";
15
- ERR["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name";
16
- ERR["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name";
17
- ERR["missingEndTagName"] = "missing-end-tag-name";
18
- ERR["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name";
19
- ERR["unknownNamedCharacterReference"] = "unknown-named-character-reference";
20
- ERR["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference";
21
- ERR["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier";
22
- ERR["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value";
23
- ERR["eofBeforeTagName"] = "eof-before-tag-name";
24
- ERR["eofInTag"] = "eof-in-tag";
25
- ERR["missingAttributeValue"] = "missing-attribute-value";
26
- ERR["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes";
27
- ERR["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword";
28
- ERR["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers";
29
- ERR["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword";
30
- ERR["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier";
31
- ERR["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier";
32
- ERR["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier";
33
- ERR["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier";
34
- ERR["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier";
35
- ERR["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier";
36
- ERR["cdataInHtmlContent"] = "cdata-in-html-content";
37
- ERR["incorrectlyOpenedComment"] = "incorrectly-opened-comment";
38
- ERR["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text";
39
- ERR["eofInDoctype"] = "eof-in-doctype";
40
- ERR["nestedComment"] = "nested-comment";
41
- ERR["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment";
42
- ERR["eofInComment"] = "eof-in-comment";
43
- ERR["incorrectlyClosedComment"] = "incorrectly-closed-comment";
44
- ERR["eofInCdata"] = "eof-in-cdata";
45
- ERR["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference";
46
- ERR["nullCharacterReference"] = "null-character-reference";
47
- ERR["surrogateCharacterReference"] = "surrogate-character-reference";
48
- ERR["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range";
49
- ERR["controlCharacterReference"] = "control-character-reference";
50
- ERR["noncharacterCharacterReference"] = "noncharacter-character-reference";
51
- ERR["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name";
52
- ERR["missingDoctypeName"] = "missing-doctype-name";
53
- ERR["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name";
54
- ERR["duplicateAttribute"] = "duplicate-attribute";
55
- ERR["nonConformingDoctype"] = "non-conforming-doctype";
56
- ERR["missingDoctype"] = "missing-doctype";
57
- ERR["misplacedDoctype"] = "misplaced-doctype";
58
- ERR["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element";
59
- ERR["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements";
60
- ERR["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head";
61
- ERR["openElementsLeftAfterEof"] = "open-elements-left-after-eof";
62
- ERR["abandonedHeadElementChild"] = "abandoned-head-element-child";
63
- ERR["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element";
64
- ERR["nestedNoscriptInHead"] = "nested-noscript-in-head";
65
- ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text";
66
- })(ERR || (exports.ERR = ERR = {}));
@@ -1,9 +0,0 @@
1
- import { TAG_ID as $, NS } from './html.js';
2
- import type { TagToken, Attribute } from './token.js';
3
- export declare const SVG_TAG_NAMES_ADJUSTMENT_MAP: Map<string, string>;
4
- export declare function causesExit(startTagToken: TagToken): boolean;
5
- export declare function adjustTokenMathMLAttrs(token: TagToken): void;
6
- export declare function adjustTokenSVGAttrs(token: TagToken): void;
7
- export declare function adjustTokenXMLAttrs(token: TagToken): void;
8
- export declare function adjustTokenSVGTagName(token: TagToken): void;
9
- export declare function isIntegrationPoint(tn: $, ns: NS, attrs: Attribute[], foreignNS?: NS): boolean;