node-html-parser 1.2.13 → 1.2.14
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/main.js +3 -2
- package/dist/nodes/html.d.ts +1 -1
- package/dist/nodes/html.js +3 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -570,12 +570,13 @@ define("nodes/html", ["require", "exports", "he", "nodes/node", "nodes/type", "n
|
|
|
570
570
|
enumerable: true,
|
|
571
571
|
configurable: true
|
|
572
572
|
});
|
|
573
|
-
HTMLElement.prototype.set_content = function (content) {
|
|
573
|
+
HTMLElement.prototype.set_content = function (content, options) {
|
|
574
|
+
if (options === void 0) { options = {}; }
|
|
574
575
|
if (content instanceof node_3.default) {
|
|
575
576
|
content = [content];
|
|
576
577
|
}
|
|
577
578
|
else if (typeof content == 'string') {
|
|
578
|
-
var r = parse(content);
|
|
579
|
+
var r = parse(content, options);
|
|
579
580
|
content = r.childNodes.length ? r.childNodes : [new text_1.default(content)];
|
|
580
581
|
}
|
|
581
582
|
this.childNodes = content;
|
package/dist/nodes/html.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export default class HTMLElement extends Node {
|
|
|
70
70
|
get structuredText(): string;
|
|
71
71
|
toString(): string;
|
|
72
72
|
get innerHTML(): string;
|
|
73
|
-
set_content(content: string | Node | Node[]): void;
|
|
73
|
+
set_content(content: string | Node | Node[], options?: Options): void;
|
|
74
74
|
get outerHTML(): string;
|
|
75
75
|
/**
|
|
76
76
|
* Trim element from right (in block) after seeing pattern in a TextNode.
|
package/dist/nodes/html.js
CHANGED
|
@@ -202,12 +202,13 @@ var HTMLElement = /** @class */ (function (_super) {
|
|
|
202
202
|
enumerable: true,
|
|
203
203
|
configurable: true
|
|
204
204
|
});
|
|
205
|
-
HTMLElement.prototype.set_content = function (content) {
|
|
205
|
+
HTMLElement.prototype.set_content = function (content, options) {
|
|
206
|
+
if (options === void 0) { options = {}; }
|
|
206
207
|
if (content instanceof node_1.default) {
|
|
207
208
|
content = [content];
|
|
208
209
|
}
|
|
209
210
|
else if (typeof content == 'string') {
|
|
210
|
-
var r = parse(content);
|
|
211
|
+
var r = parse(content, options);
|
|
211
212
|
content = r.childNodes.length ? r.childNodes : [new text_1.default(content)];
|
|
212
213
|
}
|
|
213
214
|
this.childNodes = content;
|
package/package.json
CHANGED