node-html-parser 4.1.4 → 5.2.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 +28 -0
- package/README.md +34 -25
- package/dist/main.js +177 -271
- package/dist/nodes/html.d.ts +12 -5
- package/dist/nodes/html.js +177 -271
- package/esm/index.js +11 -0
- package/esm/package.json +3 -0
- package/package.json +46 -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 -1102
- 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;
|
|
@@ -76,7 +76,9 @@ export default class HTMLElement extends Node {
|
|
|
76
76
|
*/
|
|
77
77
|
exchangeChild(oldNode: Node, newNode: Node): void;
|
|
78
78
|
get tagName(): string;
|
|
79
|
+
set tagName(newname: string);
|
|
79
80
|
get localName(): string;
|
|
81
|
+
get isVoidElement(): boolean;
|
|
80
82
|
/**
|
|
81
83
|
* Get escpaed (as-it) text value of current node and its children.
|
|
82
84
|
* @return {string} text content
|
|
@@ -125,9 +127,14 @@ export default class HTMLElement extends Node {
|
|
|
125
127
|
/**
|
|
126
128
|
* Query CSS Selector to find matching node.
|
|
127
129
|
* @param {string} selector Simplified CSS selector
|
|
128
|
-
* @return {HTMLElement} matching node
|
|
130
|
+
* @return {(HTMLElement|null)} matching node
|
|
129
131
|
*/
|
|
130
|
-
querySelector(selector: string): HTMLElement;
|
|
132
|
+
querySelector(selector: string): HTMLElement | null;
|
|
133
|
+
/**
|
|
134
|
+
* find elements by their tagName
|
|
135
|
+
* @param {string} tagName the tagName of the elements to select
|
|
136
|
+
*/
|
|
137
|
+
getElementsByTagName(tagName: string): Array<HTMLElement>;
|
|
131
138
|
/**
|
|
132
139
|
* 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
140
|
* @param selector a DOMString containing a selector list
|
|
@@ -157,7 +164,7 @@ export default class HTMLElement extends Node {
|
|
|
157
164
|
get attrs(): Attributes;
|
|
158
165
|
get attributes(): Record<string, string>;
|
|
159
166
|
/**
|
|
160
|
-
* Get escaped (as-
|
|
167
|
+
* Get escaped (as-is) attributes
|
|
161
168
|
* @return {Object} parsed attributes
|
|
162
169
|
*/
|
|
163
170
|
get rawAttributes(): RawAttributes;
|