node-html-parser 4.1.3 → 5.1.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.
- package/CHANGELOG.md +42 -0
- package/README.md +10 -4
- package/dist/main.js +175 -266
- package/dist/nodes/html.d.ts +11 -5
- package/dist/nodes/html.js +175 -266
- package/esm/index.js +11 -0
- package/esm/package.json +3 -0
- package/package.json +39 -17
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -226
- package/.mocharc.yaml +0 -1
- package/dist/esm/back.js +0 -3
- package/dist/esm/index.js +0 -7
- package/dist/esm/matcher.js +0 -101
- package/dist/esm/nodes/comment.js +0 -23
- package/dist/esm/nodes/html.js +0 -1096
- package/dist/esm/nodes/node.js +0 -25
- package/dist/esm/nodes/text.js +0 -95
- package/dist/esm/nodes/type.js +0 -7
- package/dist/esm/parse.js +0 -1
- package/dist/esm/valid.js +0 -9
package/dist/nodes/html.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare class DOMTokenList {
|
|
|
15
15
|
private _set;
|
|
16
16
|
private _afterUpdate;
|
|
17
17
|
private _validate;
|
|
18
|
-
constructor(valuesInit?: string[], afterUpdate?: (
|
|
18
|
+
constructor(valuesInit?: string[], afterUpdate?: (t: DOMTokenList) => void);
|
|
19
19
|
add(c: string): void;
|
|
20
20
|
replace(c1: string, c2: string): void;
|
|
21
21
|
remove(c: string): void;
|
|
@@ -36,7 +36,7 @@ declare class DOMTokenList {
|
|
|
36
36
|
* @extends {Node}
|
|
37
37
|
*/
|
|
38
38
|
export default class HTMLElement extends Node {
|
|
39
|
-
|
|
39
|
+
rawAttrs: string;
|
|
40
40
|
private _attrs;
|
|
41
41
|
private _rawAttrs;
|
|
42
42
|
rawTagName: string;
|
|
@@ -77,6 +77,7 @@ export default class HTMLElement extends Node {
|
|
|
77
77
|
exchangeChild(oldNode: Node, newNode: Node): void;
|
|
78
78
|
get tagName(): string;
|
|
79
79
|
get localName(): string;
|
|
80
|
+
get isVoidElement(): boolean;
|
|
80
81
|
/**
|
|
81
82
|
* Get escpaed (as-it) text value of current node and its children.
|
|
82
83
|
* @return {string} text content
|
|
@@ -125,9 +126,14 @@ export default class HTMLElement extends Node {
|
|
|
125
126
|
/**
|
|
126
127
|
* Query CSS Selector to find matching node.
|
|
127
128
|
* @param {string} selector Simplified CSS selector
|
|
128
|
-
* @return {HTMLElement} matching node
|
|
129
|
+
* @return {(HTMLElement|null)} matching node
|
|
129
130
|
*/
|
|
130
|
-
querySelector(selector: string): HTMLElement;
|
|
131
|
+
querySelector(selector: string): HTMLElement | null;
|
|
132
|
+
/**
|
|
133
|
+
* find elements by their tagName
|
|
134
|
+
* @param {string} tagName the tagName of the elements to select
|
|
135
|
+
*/
|
|
136
|
+
getElementsByTagName(tagName: string): Array<HTMLElement>;
|
|
131
137
|
/**
|
|
132
138
|
* traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. Will return itself or the matching ancestor. If no such element exists, it returns null.
|
|
133
139
|
* @param selector a DOMString containing a selector list
|
|
@@ -157,7 +163,7 @@ export default class HTMLElement extends Node {
|
|
|
157
163
|
get attrs(): Attributes;
|
|
158
164
|
get attributes(): Record<string, string>;
|
|
159
165
|
/**
|
|
160
|
-
* Get escaped (as-
|
|
166
|
+
* Get escaped (as-is) attributes
|
|
161
167
|
* @return {Object} parsed attributes
|
|
162
168
|
*/
|
|
163
169
|
get rawAttributes(): RawAttributes;
|