html-validate 10.13.0 → 10.13.1
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.
- package/dist/cjs/core.js +116 -5
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +5 -1
- package/dist/cjs/elements.js.map +1 -1
- package/dist/esm/core.js +116 -5
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/elements.js +5 -1
- package/dist/esm/elements.js.map +1 -1
- package/dist/schema/elements.json +25 -1
- package/dist/types/browser.d.ts +43 -0
- package/dist/types/index.d.ts +43 -0
- package/package.json +1 -1
|
@@ -85,11 +85,35 @@
|
|
|
85
85
|
|
|
86
86
|
"implicitClosed": {
|
|
87
87
|
"title": "List of elements which implicitly closes this element",
|
|
88
|
-
"description": "Some elements are automatically closed when another start tag occurs",
|
|
88
|
+
"description": "Some elements are automatically closed when another start tag occurs. Entries may be explicit tag names or @category strings (e.g. \"@flow\").",
|
|
89
89
|
"type": "array",
|
|
90
90
|
"items": { "type": "string" }
|
|
91
91
|
},
|
|
92
92
|
|
|
93
|
+
"implicitOpen": {
|
|
94
|
+
"title": "Implicit-open rules for child elements",
|
|
95
|
+
"description": "Describes intermediary elements (e.g. <head> or <body>) that should be implicitly opened when a child of a given category or tag is inserted directly under this element without a matching container being present.",
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"required": ["for", "open"],
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"properties": {
|
|
102
|
+
"for": {
|
|
103
|
+
"title": "Selector list",
|
|
104
|
+
"description": "Tag names or @category strings (e.g. \"@flow\") that trigger the implicit open.",
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": { "type": "string" }
|
|
107
|
+
},
|
|
108
|
+
"open": {
|
|
109
|
+
"title": "Element to open",
|
|
110
|
+
"description": "Tag name of the element to implicitly open.",
|
|
111
|
+
"type": "string"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
|
|
93
117
|
"optionalEnd": {
|
|
94
118
|
"title": "Mark element as having an optional end tag",
|
|
95
119
|
"description": "Elements whose end tag may be omitted per the HTML spec. Such an element is treated as implicitly closed at end-of-document and when a parent’s explicit end tag is encountered while it is still open.",
|
package/dist/types/browser.d.ts
CHANGED
|
@@ -1334,6 +1334,25 @@ export declare class HtmlValidate {
|
|
|
1334
1334
|
flushConfigCache(filename?: string): void;
|
|
1335
1335
|
}
|
|
1336
1336
|
|
|
1337
|
+
/**
|
|
1338
|
+
* Describes a single implicit-open rule for a parent element.
|
|
1339
|
+
*
|
|
1340
|
+
* When a child element matching one of the `for` selectors would be inserted
|
|
1341
|
+
* directly under the parent but is not permitted there, the element named by
|
|
1342
|
+
* `open` is implicitly opened first, making it the new insertion point.
|
|
1343
|
+
*
|
|
1344
|
+
* Selectors may be explicit tag names (e.g., `title`) or content-category
|
|
1345
|
+
* shorthand strings prefixed with `@` (e.g., `@meta`, `@flow`).
|
|
1346
|
+
*
|
|
1347
|
+
* @public
|
|
1348
|
+
*/
|
|
1349
|
+
export declare interface ImplicitOpenEntry {
|
|
1350
|
+
/** Tags or `@category` selectors that trigger the implicit open. */
|
|
1351
|
+
for: string[];
|
|
1352
|
+
/** Tag name of the element to implicitly open. */
|
|
1353
|
+
open: string;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1337
1356
|
/**
|
|
1338
1357
|
* @public
|
|
1339
1358
|
*/
|
|
@@ -1576,6 +1595,17 @@ export declare interface MetaData {
|
|
|
1576
1595
|
* still open (e.g. `</html>` implicitly closing an open `<body>`).
|
|
1577
1596
|
*/
|
|
1578
1597
|
optionalEnd?: boolean;
|
|
1598
|
+
/**
|
|
1599
|
+
* Describes elements that should be implicitly opened when a child element
|
|
1600
|
+
* that would otherwise be inserted directly under this element matches one of
|
|
1601
|
+
* the given selectors but is not permitted here.
|
|
1602
|
+
*
|
|
1603
|
+
* This handles the HTML5 optional start-tag algorithm for `<head>` and
|
|
1604
|
+
* `<body>`: when a metadata element arrives directly under `<html>`, the
|
|
1605
|
+
* parser implicitly opens `<head>`; when a flow element arrives, it implicitly
|
|
1606
|
+
* opens `<body>` (first closing any open `<head>`).
|
|
1607
|
+
*/
|
|
1608
|
+
implicitOpen?: ImplicitOpenEntry[];
|
|
1579
1609
|
scriptSupporting?: boolean;
|
|
1580
1610
|
/** Mark element as able to receive focus (without explicit `tabindex`) */
|
|
1581
1611
|
focusable?: boolean | MetaFocusableCallback;
|
|
@@ -1888,6 +1918,19 @@ export declare class Parser {
|
|
|
1888
1918
|
* stack when is allowed to omit.
|
|
1889
1919
|
*/
|
|
1890
1920
|
private closeOptional;
|
|
1921
|
+
/**
|
|
1922
|
+
* Check whether an intermediary element (e.g. `<head>` or `<body>`) should
|
|
1923
|
+
* be implicitly opened before the incoming element is inserted under
|
|
1924
|
+
* `parent`.
|
|
1925
|
+
*
|
|
1926
|
+
* If the parent's metadata defines an `implicitOpen` rule that matches the
|
|
1927
|
+
* incoming element, a new `HtmlElement` for the intermediary is created and
|
|
1928
|
+
* returned (with `parent` as its parent). The caller is responsible for
|
|
1929
|
+
* pushing it onto the active stack and firing the relevant events.
|
|
1930
|
+
*
|
|
1931
|
+
* Returns `null` when no implicit open is required.
|
|
1932
|
+
*/
|
|
1933
|
+
private peekImplicitOpen;
|
|
1891
1934
|
/* Excluded from this release type: consume */
|
|
1892
1935
|
/* Excluded from this release type: consumeTag */
|
|
1893
1936
|
/* Excluded from this release type: closeElement */
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1570,6 +1570,25 @@ export declare class HtmlValidate {
|
|
|
1570
1570
|
flushConfigCache(filename?: string): void;
|
|
1571
1571
|
}
|
|
1572
1572
|
|
|
1573
|
+
/**
|
|
1574
|
+
* Describes a single implicit-open rule for a parent element.
|
|
1575
|
+
*
|
|
1576
|
+
* When a child element matching one of the `for` selectors would be inserted
|
|
1577
|
+
* directly under the parent but is not permitted there, the element named by
|
|
1578
|
+
* `open` is implicitly opened first, making it the new insertion point.
|
|
1579
|
+
*
|
|
1580
|
+
* Selectors may be explicit tag names (e.g., `title`) or content-category
|
|
1581
|
+
* shorthand strings prefixed with `@` (e.g., `@meta`, `@flow`).
|
|
1582
|
+
*
|
|
1583
|
+
* @public
|
|
1584
|
+
*/
|
|
1585
|
+
export declare interface ImplicitOpenEntry {
|
|
1586
|
+
/** Tags or `@category` selectors that trigger the implicit open. */
|
|
1587
|
+
for: string[];
|
|
1588
|
+
/** Tag name of the element to implicitly open. */
|
|
1589
|
+
open: string;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1573
1592
|
/**
|
|
1574
1593
|
* @public
|
|
1575
1594
|
*/
|
|
@@ -1819,6 +1838,17 @@ export declare interface MetaData {
|
|
|
1819
1838
|
* still open (e.g. `</html>` implicitly closing an open `<body>`).
|
|
1820
1839
|
*/
|
|
1821
1840
|
optionalEnd?: boolean;
|
|
1841
|
+
/**
|
|
1842
|
+
* Describes elements that should be implicitly opened when a child element
|
|
1843
|
+
* that would otherwise be inserted directly under this element matches one of
|
|
1844
|
+
* the given selectors but is not permitted here.
|
|
1845
|
+
*
|
|
1846
|
+
* This handles the HTML5 optional start-tag algorithm for `<head>` and
|
|
1847
|
+
* `<body>`: when a metadata element arrives directly under `<html>`, the
|
|
1848
|
+
* parser implicitly opens `<head>`; when a flow element arrives, it implicitly
|
|
1849
|
+
* opens `<body>` (first closing any open `<head>`).
|
|
1850
|
+
*/
|
|
1851
|
+
implicitOpen?: ImplicitOpenEntry[];
|
|
1822
1852
|
scriptSupporting?: boolean;
|
|
1823
1853
|
/** Mark element as able to receive focus (without explicit `tabindex`) */
|
|
1824
1854
|
focusable?: boolean | MetaFocusableCallback;
|
|
@@ -2156,6 +2186,19 @@ export declare class Parser {
|
|
|
2156
2186
|
* stack when is allowed to omit.
|
|
2157
2187
|
*/
|
|
2158
2188
|
private closeOptional;
|
|
2189
|
+
/**
|
|
2190
|
+
* Check whether an intermediary element (e.g. `<head>` or `<body>`) should
|
|
2191
|
+
* be implicitly opened before the incoming element is inserted under
|
|
2192
|
+
* `parent`.
|
|
2193
|
+
*
|
|
2194
|
+
* If the parent's metadata defines an `implicitOpen` rule that matches the
|
|
2195
|
+
* incoming element, a new `HtmlElement` for the intermediary is created and
|
|
2196
|
+
* returned (with `parent` as its parent). The caller is responsible for
|
|
2197
|
+
* pushing it onto the active stack and firing the relevant events.
|
|
2198
|
+
*
|
|
2199
|
+
* Returns `null` when no implicit open is required.
|
|
2200
|
+
*/
|
|
2201
|
+
private peekImplicitOpen;
|
|
2159
2202
|
/* Excluded from this release type: consume */
|
|
2160
2203
|
/* Excluded from this release type: consumeTag */
|
|
2161
2204
|
/* Excluded from this release type: closeElement */
|