node-html-parser 6.1.6 → 6.1.7

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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [6.1.7](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.6...v6.1.7) (2023-09-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * block text elements [#242](https://github.com/taoqf/node-fast-html-parser/issues/242) ([97e593c](https://github.com/taoqf/node-fast-html-parser/commit/97e593c2bdefbfefd35c2c9ccaef914517d60fe7))
11
+ * docs [#245](https://github.com/taoqf/node-fast-html-parser/issues/245) ([f656c7b](https://github.com/taoqf/node-fast-html-parser/commit/f656c7b2de2a62a9a363f797c6f03a2477e7312e))
12
+ * remove test code ([d3980c5](https://github.com/taoqf/node-fast-html-parser/commit/d3980c5fb7744d6fda4b270619bb581a19a4cb18))
13
+
5
14
  ### [6.1.6](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.5...v6.1.6) (2023-08-17)
6
15
 
7
16
 
package/README.md CHANGED
@@ -10,7 +10,6 @@ no closing `<li>`, `<td>` etc).
10
10
 
11
11
  ## Install
12
12
 
13
-
14
13
  ```shell
15
14
  npm install --save node-html-parser
16
15
  ```
@@ -86,7 +85,7 @@ Parse the data provided, and return the root of the generated DOM.
86
85
  comment: false, // retrieve comments (hurts performance slightly)
87
86
  voidTag:{
88
87
  tags: ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'], // optional and case insensitive, default value is ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']
89
- addClosingSlash: true // optional, default false. void tag serialisation, add a final slash <br/>
88
+ closingSlash: true // optional, default false. void tag serialisation, add a final slash <br/>
90
89
  },
91
90
  blockTextElements: {
92
91
  script: true, // keep text content when parsing
@@ -293,7 +292,7 @@ Get class names.
293
292
 
294
293
  Clone a node.
295
294
 
296
- #### getElementById(id: string): HTMLElement;
295
+ #### getElementById(id: string): HTMLElement
297
296
 
298
297
  Get element by it's ID.
299
298
 
package/dist/main.js CHANGED
@@ -1381,7 +1381,9 @@ define("nodes/html", ["require", "exports", "css-select", "he", "back", "matcher
1381
1381
  style: true,
1382
1382
  pre: true,
1383
1383
  };
1384
- var element_names = Object.keys(elements);
1384
+ var element_names = Object.keys(elements).filter(function (name) {
1385
+ return Boolean(elements[name]);
1386
+ });
1385
1387
  var kBlockTextElements = element_names.map(function (it) { return new RegExp("^".concat(it, "$"), 'i'); });
1386
1388
  var kIgnoreElements = element_names.filter(function (it) { return elements[it]; }).map(function (it) { return new RegExp("^".concat(it, "$"), 'i'); });
1387
1389
  function element_should_be_ignore(tag) {
@@ -1047,7 +1047,9 @@ function base_parse(data, options) {
1047
1047
  style: true,
1048
1048
  pre: true,
1049
1049
  };
1050
- var element_names = Object.keys(elements);
1050
+ var element_names = Object.keys(elements).filter(function (name) {
1051
+ return Boolean(elements[name]);
1052
+ });
1051
1053
  var kBlockTextElements = element_names.map(function (it) { return new RegExp("^".concat(it, "$"), 'i'); });
1052
1054
  var kIgnoreElements = element_names.filter(function (it) { return elements[it]; }).map(function (it) { return new RegExp("^".concat(it, "$"), 'i'); });
1053
1055
  function element_should_be_ignore(tag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-html-parser",
3
- "version": "6.1.6",
3
+ "version": "6.1.7",
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",