node-html-parser
Advanced tools
Comparing version 5.4.2 to 6.0.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [6.0.0](https://github.com/taoqf/node-fast-html-parser/compare/v5.4.2-0...v6.0.0) (2022-09-08) | ||
### Bug Fixes | ||
* Preserve invalid nested A tags in AST (see [#215](https://github.com/taoqf/node-fast-html-parser/issues/215) for detail) ([374188f](https://github.com/taoqf/node-fast-html-parser/commit/374188f1c6d6c6d0567348b8e8d20957f5a93fb8)) | ||
### [5.4.2](https://github.com/taoqf/node-fast-html-parser/compare/v5.4.2-0...v5.4.2) (2022-08-30) | ||
@@ -7,0 +14,0 @@ |
@@ -206,2 +206,6 @@ import VoidTag from '../void-tag'; | ||
comment: boolean; | ||
/** | ||
* @see PR #215 for explanation | ||
*/ | ||
fixNestedATags?: boolean; | ||
parseNoneClosedTags?: boolean; | ||
@@ -208,0 +212,0 @@ blockTextElements: { |
@@ -1063,3 +1063,3 @@ "use strict"; | ||
data = "<".concat(frameflag, ">").concat(data, "</").concat(frameflag, ">"); | ||
var lowerCaseTagName = options.lowerCaseTagName; | ||
var lowerCaseTagName = options.lowerCaseTagName, fixNestedATags = options.fixNestedATags; | ||
var dataEndPos = data.length - (frameflag.length + 2); | ||
@@ -1116,3 +1116,3 @@ var frameFlagOffset = frameflag.length + 2; | ||
// Prevent nested A tags by terminating the last A and starting a new one : see issue #144 | ||
if (tagName === 'a' || tagName === 'A') { | ||
if (fixNestedATags && (tagName === 'a' || tagName === 'A')) { | ||
if (noNestedTagIndex !== undefined) { | ||
@@ -1156,3 +1156,3 @@ stack.splice(noNestedTagIndex); | ||
while (true) { | ||
if (tagName === 'a' || tagName === 'A') | ||
if (noNestedTagIndex != null && (tagName === 'a' || tagName === 'A')) | ||
noNestedTagIndex = undefined; | ||
@@ -1159,0 +1159,0 @@ if (currentParent.rawTagName === tagName) { |
{ | ||
"name": "node-html-parser", | ||
"version": "5.4.2", | ||
"version": "6.0.0", | ||
"description": "A very fast HTML parser, generating a simplified DOM, with basic element query support.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
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
156563
3724