posthtml-parser
Advanced tools
Comparing version 0.7.2 to 0.8.0
@@ -0,3 +1,11 @@ | ||
## 0.8.0 (2021-04-16) | ||
* ci: drop support for node 10 (found not to be working) ([585d552](https://github.com/posthtml/posthtml-parser/commit/585d552)) | ||
* build: add prepare script ([1dc46fc](https://github.com/posthtml/posthtml-parser/commit/1dc46fc)) | ||
## <small>0.7.2 (2021-04-12)</small> | ||
* 0.7.2 ([7beaee9](https://github.com/posthtml/posthtml-parser/commit/7beaee9)) | ||
* fix: correctly parse text content after comments ([818e2f5](https://github.com/posthtml/posthtml-parser/commit/818e2f5)) | ||
@@ -4,0 +12,0 @@ * build(deps): bump y18n from 4.0.0 to 4.0.1 ([6b52ac1](https://github.com/posthtml/posthtml-parser/commit/6b52ac1)) |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _htmlparser2 = require('htmlparser2');var j={lowerCaseTags:!1,lowerCaseAttributeNames:!1,decodeEntities:!1},O=[{name:"!doctype",start:"<",end:">"}],v=(p,f={})=>{let s=[],r=[];function i(){return s[s.length-1]}function l(e,t){return e.name instanceof RegExp?new RegExp(e.name.source,"i").test(t):t===e.name}function g(e){let t={};return Object.keys(e).forEach(n=>{let o={};o[n]=e[n].replace(/"/g,'"'),Object.assign(t,o)}),t}function b(e,t){var a;let n=O.concat((a=f.directives)!=null?a:[]),o=i();for(let c of n){let d=c.start+t+c.end;if(l(c,e.toLowerCase())){if(o===void 0){r.push(d);return}typeof o=="object"&&(o.content===void 0&&(o.content=[]),o.content.push(d))}}}function h(e){let t=`<!--${e}-->`,n=i();if(n===void 0){r.push(t);return}typeof n=="object"&&(n.content===void 0&&(n.content=[]),n.content.push(t))}function m(e,t){let n={tag:e};Object.keys(t).length>0&&(n.attrs=g(t)),s.push(n)}function N(){let e=s.pop();if(e){let t=i();if(s.length<=0){r.push(e);return}typeof t=="object"&&(t.content===void 0&&(t.content=[]),t.content.push(e))}}function y(e){let t=i();if(t===void 0){r.push(e);return}if(typeof t=="object"){if(t.content&&t.content.length>0){let n=t.content[t.content.length-1];if(typeof n=="string"){t.content[t.content.length-1]=`${n}${e}`;return}}t.content===void 0&&(t.content=[]),t.content.push(e)}}let u=new (0, _htmlparser2.Parser)({onprocessinginstruction:b,oncomment:h,onopentag:m,onclosetag:N,ontext:y},{...j,...f});return u.write(p),u.end(),r},w= exports.default =v;exports.default = w; | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _htmlparser2 = require('htmlparser2');var j={lowerCaseTags:!1,lowerCaseAttributeNames:!1,decodeEntities:!1},O=[{name:"!doctype",start:"<",end:">"}],v=(p,f={})=>{let s=[],r=[];function i(){return s[s.length-1]}function l(e,t){return e.name instanceof RegExp?new RegExp(e.name.source,"i").test(t):t===e.name}function g(e){let t={};return Object.keys(e).forEach(n=>{let o={};o[n]=e[n].replace(/"/g,'"'),Object.assign(t,o)}),t}function b(e,t){var a;let n=O.concat((a=f.directives)!=null?a:[]),o=i();for(let c of n){let d=c.start+t+c.end;if(l(c,e.toLowerCase())){if(o===void 0){r.push(d);return}typeof o=="object"&&(o.content===void 0&&(o.content=[]),o.content.push(d))}}}function h(e){let t=`<!--${e}-->`,n=i();if(n===void 0){r.push(t);return}typeof n=="object"&&(n.content===void 0&&(n.content=[]),n.content.push(t))}function m(e,t){let n={tag:e};Object.keys(t).length>0&&(n.attrs=g(t)),s.push(n)}function N(){let e=s.pop();if(e){let t=i();if(s.length<=0){r.push(e);return}typeof t=="object"&&(t.content===void 0&&(t.content=[]),t.content.push(e))}}function y(e){let t=i();if(t===void 0){r.push(e);return}if(typeof t=="object"){if(t.content&&t.content.length>0){let n=t.content[t.content.length-1];if(typeof n=="string"&&!n.startsWith("<!--")){t.content[t.content.length-1]=`${n}${e}`;return}}t.content===void 0&&(t.content=[]),t.content.push(e)}}let u=new (0, _htmlparser2.Parser)({onprocessinginstruction:b,oncomment:h,onopentag:m,onclosetag:N,ontext:y},{...j,...f});return u.write(p),u.end(),r},w= exports.default =v;exports.default = w; |
{ | ||
"name": "posthtml-parser", | ||
"version": "0.7.2", | ||
"version": "0.8.0", | ||
"description": "Parse HTML/XML to PostHTMLTree", | ||
@@ -24,3 +24,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
@@ -32,3 +32,4 @@ "scripts": { | ||
"test": "xo && c8 ava", | ||
"pretest": "clinton" | ||
"pretest": "clinton", | ||
"prepare": "npm run build" | ||
}, | ||
@@ -35,0 +36,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
34489