node-html-parser 1.2.15 → 1.2.16

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 CHANGED
@@ -544,15 +544,11 @@ define("nodes/html", ["require", "exports", "he", "nodes/node", "nodes/type", "n
544
544
  HTMLElement.prototype.toString = function () {
545
545
  var tag = this.tagName;
546
546
  if (tag) {
547
- var is_un_closed = /^meta$/i.test(tag);
548
- var is_self_closed = /^(img|br|hr|area|base|input|doctype|link)$/i.test(tag);
547
+ var is_void = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i.test(tag);
549
548
  var attrs = this.rawAttrs ? ' ' + this.rawAttrs : '';
550
- if (is_un_closed) {
549
+ if (is_void) {
551
550
  return "<" + tag + attrs + ">";
552
551
  }
553
- else if (is_self_closed) {
554
- return "<" + tag + attrs + " />";
555
- }
556
552
  else {
557
553
  return "<" + tag + attrs + ">" + this.innerHTML + "</" + tag + ">";
558
554
  }
@@ -176,15 +176,11 @@ var HTMLElement = /** @class */ (function (_super) {
176
176
  HTMLElement.prototype.toString = function () {
177
177
  var tag = this.tagName;
178
178
  if (tag) {
179
- var is_un_closed = /^meta$/i.test(tag);
180
- var is_self_closed = /^(img|br|hr|area|base|input|doctype|link)$/i.test(tag);
179
+ var is_void = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i.test(tag);
181
180
  var attrs = this.rawAttrs ? ' ' + this.rawAttrs : '';
182
- if (is_un_closed) {
181
+ if (is_void) {
183
182
  return "<" + tag + attrs + ">";
184
183
  }
185
- else if (is_self_closed) {
186
- return "<" + tag + attrs + " />";
187
- }
188
184
  else {
189
185
  return "<" + tag + attrs + ">" + this.innerHTML + "</" + tag + ">";
190
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-html-parser",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "description": "A very fast HTML parser, generating a simplified DOM, with basic element query support.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",