node-html-light
Advanced tools
Comparing version 2.8.0 to 2.8.1
@@ -0,1 +1,15 @@ | ||
## [2.8.1](https://github.com/stfsy/node-html-light/compare/v2.8.0...v2.8.1) (2021-07-05) | ||
### Bug Fixes | ||
* some html entities get encoded ([cffd8f1](https://github.com/stfsy/node-html-light/commit/cffd8f13feb86bef3d0aa35ea0b392856071f684)) | ||
### Features | ||
* use parseDocument instead of parseDom and set default options ([39808b4](https://github.com/stfsy/node-html-light/commit/39808b483ba2ffebdd0a93f25298faf72cb48118)) | ||
# [2.8.0](https://github.com/stfsy/node-html-light/compare/v2.7.0...v2.8.0) (2021-06-28) | ||
@@ -2,0 +16,0 @@ |
@@ -5,2 +5,3 @@ 'use strict' | ||
const domUtils = htmlParser.DomUtils | ||
const domSerializer = require('dom-serializer') | ||
const fs = require('fs') | ||
@@ -56,3 +57,10 @@ | ||
const parsed = htmlParser.parseDOM(string) | ||
const parsed = htmlParser.parseDocument(string, { | ||
recognizeCDATA: false, | ||
recognizeSelfClosing: false, | ||
lowerCaseAttributeNames: false, | ||
lowerCaseTags: false, | ||
xmlMode: false, | ||
decodeEntities: false | ||
}).children | ||
@@ -178,6 +186,6 @@ if (parsed.length > 1) { | ||
/** | ||
* Returns the next sibling of the current node | ||
* @returns {Node} | ||
*/ | ||
/** | ||
* Returns the next sibling of the current node | ||
* @returns {Node} | ||
*/ | ||
get nextSibling() { | ||
@@ -308,3 +316,8 @@ let next = this.get().next | ||
toHtml() { | ||
return domUtils.getOuterHTML(this._element) | ||
return domSerializer.default(this._element, { | ||
decodeEntities: false, | ||
selfClosingTags: false, | ||
emptyAttrs: false, | ||
xmlMode: false | ||
}) | ||
} | ||
@@ -311,0 +324,0 @@ } |
{ | ||
"name": "node-html-light", | ||
"version": "2.8.0", | ||
"version": "2.8.1", | ||
"description": "HTML Parser for NodeJS providing a lightweight object oriented interface", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
38632
529