node-html-parser
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -7,20 +7,6 @@ # Changelog | ||
### ⚠ BREAKING CHANGES | ||
* Add esm named export support (closes #160 closes #139) | ||
### Features | ||
* Add esm named export support (closes [#160](https://github.com/taoqf/node-fast-html-parser/issues/160) closes [#139](https://github.com/taoqf/node-fast-html-parser/issues/139)) ([0d4b922](https://github.com/taoqf/node-fast-html-parser/commit/0d4b922eefd6210fe802991e464b21b0c69d5f63)) | ||
* Added HTMLElement#getElementsByTagName ([d462e44](https://github.com/taoqf/node-fast-html-parser/commit/d462e449e7ebb00a5a43fb574133681ad5a62475)) | ||
* Expose `HTMLElement#rawAttrs` (make public) ([34f1595](https://github.com/taoqf/node-fast-html-parser/commit/34f1595756c0974b6ae7ef5755a615f09e421f32)) | ||
* Improved parsing performance + matching (closes [#164](https://github.com/taoqf/node-fast-html-parser/issues/164)) ([3c5b8e2](https://github.com/taoqf/node-fast-html-parser/commit/3c5b8e2a9104b01a8ca899a7970507463e42adaf)) | ||
* Exposed `HTMLElement#rawAttrs` (made public) ([34f1595](https://github.com/taoqf/node-fast-html-parser/commit/34f1595756c0974b6ae7ef5755a615f09e421f32)) | ||
### Bug Fixes | ||
* Add null to return type for HTMLElement#querySelector (closes [#157](https://github.com/taoqf/node-fast-html-parser/issues/157)) ([2b65583](https://github.com/taoqf/node-fast-html-parser/commit/2b655839bd3868c41fb19cae5786ca097565bc7f)) | ||
* blockTextElements incorrectly matching partial tag (detail) (fixes [#156](https://github.com/taoqf/node-fast-html-parser/issues/156) fixes [#124](https://github.com/taoqf/node-fast-html-parser/issues/124)) ([6823349](https://github.com/taoqf/node-fast-html-parser/commit/6823349fdf1809c7484c70d948aa24930ef4983f)) | ||
## [5.0.0](https://github.com/taoqf/node-fast-html-parser/compare/v4.1.5...v5.0.0) (2021-10-10) | ||
@@ -27,0 +13,0 @@ |
@@ -485,2 +485,5 @@ var __extends = (this && this.__extends) || (function () { | ||
}, | ||
set: function (newname) { | ||
this.rawTagName = newname.toLowerCase(); | ||
}, | ||
enumerable: false, | ||
@@ -487,0 +490,0 @@ configurable: true |
@@ -79,2 +79,3 @@ import Node from './node'; | ||
get tagName(): string; | ||
set tagName(newname: string); | ||
get localName(): string; | ||
@@ -81,0 +82,0 @@ get isVoidElement(): boolean; |
@@ -239,2 +239,5 @@ "use strict"; | ||
}, | ||
set: function (newname) { | ||
this.rawTagName = newname.toLowerCase(); | ||
}, | ||
enumerable: false, | ||
@@ -241,0 +244,0 @@ configurable: true |
{ | ||
"name": "node-html-parser", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "A very fast HTML parser, generating a simplified DOM, with basic element query support.", | ||
@@ -63,3 +63,3 @@ "main": "dist/index.js", | ||
"cheerio": "^1.0.0-rc.5", | ||
"rimraf": "^3.0.2", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^7.32.0", | ||
@@ -69,2 +69,7 @@ "eslint-config-prettier": "latest", | ||
"high5": "^1.0.0", | ||
"html-dom-parser": "^1.0.4", | ||
"html-parser": "^0.11.0", | ||
"html5": "^1.0.5", | ||
"html5parser": "^2.0.2", | ||
"htmljs-parser": "^2.11.1", | ||
"htmlparser": "^1.7.7", | ||
@@ -75,4 +80,7 @@ "htmlparser-benchmark": "^1.1.3", | ||
"mocha-each": "^2.0.1", | ||
"neutron-html5parser": "^0.2.0", | ||
"np": "latest", | ||
"parse5": "^6.0.1", | ||
"rimraf": "^3.0.2", | ||
"saxes": "^6.0.0", | ||
"should": "latest", | ||
@@ -83,4 +91,3 @@ "spec": "latest", | ||
"ts-node": "^10.2.1", | ||
"typescript": "latest", | ||
"cross-env": "^7.0.3" | ||
"typescript": "latest" | ||
}, | ||
@@ -87,0 +94,0 @@ "config": { |
@@ -22,11 +22,14 @@ # Fast HTML Parser [![NPM version](https://badge.fury.io/js/node-html-parser.png)](http://badge.fury.io/js/node-html-parser) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ftaoqf%2Fnode-html-parser%2Fbadge%3Fref%3Dmain&style=flat)](https://actions-badge.atrox.dev/taoqf/node-html-parser/goto?ref=main) | ||
Faster than htmlparser2! | ||
```shell | ||
htmlparser :26.7111 ms/file ± 170.066 | ||
cheerio :24.2480 ms/file ± 17.1711 | ||
parse5 :13.7239 ms/file ± 8.68561 | ||
high5 :7.75466 ms/file ± 5.33549 | ||
htmlparser2 :5.27376 ms/file ± 8.68456 | ||
node-html-parser:2.85768 ms/file ± 2.87784 | ||
cheerio :12.0726 ms/file ± 7.31605 | ||
parse5 :8.18615 ms/file ± 6.15337 | ||
node-html-parser (last release):2.16533 ms/file ± 1.56924 | ||
htmlparser :17.0658 ms/file ± 120.901 | ||
htmlparser2 :2.62695 ms/file ± 4.17579 | ||
node-html-parser:2.14907 ms/file ± 1.66632 | ||
html-parser :24.6505 ms/file ± 18.9996 | ||
htmljs-parser :5.81797 ms/file ± 6.55537 | ||
html-dom-parser :2.52265 ms/file ± 3.54858 | ||
html5parser :2.01144 ms/file ± 2.53570 | ||
high5 :3.91342 ms/file ± 2.65563 | ||
``` | ||
@@ -74,3 +77,3 @@ | ||
Parse given data, and return root of the generated DOM. | ||
Parse the data provided, and return the root of the generated DOM. | ||
@@ -82,4 +85,4 @@ - **data**, data to parse | ||
{ | ||
lowerCaseTagName: false, // convert tag name to lower case (hurt performance heavily) | ||
comment: false, // retrieve comments (hurt performance slightly) | ||
lowerCaseTagName: false, // convert tag name to lower case (hurts performance heavily) | ||
comment: false, // retrieve comments (hurts performance slightly) | ||
blockTextElements: { | ||
@@ -96,3 +99,3 @@ script: true, // keep text content when parsing | ||
Parse given data, return true if the givent data is valid, and return false if not. | ||
Parse the data provided, return true if the given data is valid, and return false if not. | ||
@@ -113,3 +116,3 @@ ## HTMLElement Methods | ||
Note: Full css3 selector supported since v3.0.0. | ||
Note: Full range of CSS3 selectors supported since v3.0.0. | ||
@@ -124,3 +127,3 @@ ### HTMLElement#querySelector(selector) | ||
Note: * for all elements. | ||
Note: Use * for all elements. | ||
@@ -137,3 +140,3 @@ ### HTMLElement#closest(selector) | ||
parses the specified text as HTML and inserts the resulting nodes into the DOM tree at a specified position. | ||
Parses the specified text as HTML and inserts the resulting nodes into the DOM tree at a specified position. | ||
@@ -196,11 +199,11 @@ ### HTMLElement#setAttribute(key: string, value: string) | ||
Toggle class. | ||
Toggle class. Remove it if it is already included, otherwise add. | ||
#### HTMLElement#classList.contains(className: string): boolean | ||
Get if contains | ||
Returns true if the classname is already in the classList. | ||
#### HTMLElement#classList.values() | ||
get class names | ||
Get class names. | ||
@@ -216,3 +219,3 @@ ## HTMLElement Properties | ||
Get escaped (as-it) text value of current node and its children. May have | ||
Get escaped (as-is) text value of current node and its children. May have | ||
`&` in it. (fast) | ||
@@ -222,19 +225,19 @@ | ||
Get tag name of HTMLElement. Notice: the returned value would be an uppercase string. | ||
Get or Set tag name of HTMLElement. Notice: the returned value would be an uppercase string. | ||
### HTMLElement#structuredText | ||
Get structured Text | ||
Get structured Text. | ||
### HTMLElement#structure | ||
Get DOM structure | ||
Get DOM structure. | ||
### HTMLElement#firstChild | ||
Get first child node | ||
Get first child node. | ||
### HTMLElement#lastChild | ||
Get last child node | ||
Get last child node. | ||
@@ -241,0 +244,0 @@ ### HTMLElement#innerHTML |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3358
265
141454
34