Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

preact-parser

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preact-parser - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6

2

dist/index.es5.js

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return function(){"use strict";var e={611:function(e,t){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.isIgnored=t.isBlockText=t.createRange=t.createText=t.createElement=t.frameflag=t.closedByClosing=t.closedByOpening=t.blockTextElements=t.selfClosingTags=t.attrRegex=t.htmlRegex=t.NodeType=void 0,function(e){e[e.Element=1]="Element",e[e.Text=3]="Text"}(n||(n={})),t.NodeType=n,t.htmlRegex=/<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g,t.attrRegex=/(\S+)\s*=\s*(\"?)([^"]*)(\2|\s|$)/gi;var a="documentfragmentcontainer";t.frameflag=a,t.selfClosingTags=["area","base","br","col","hr","img","input","link","meta","source","embed","param","track","wbr"];var o=["script","noscript","style","pre"];function i(e){var t=e.nodeName,a=void 0===t?e.tagName:t,o={nodeName:"BODY",nodeType:n.Element,tagName:"body",tagRange:[],attributes:[],childNodes:[]};return e&&(o=r(r(r({},o),e),{nodeName:a})),o}t.blockTextElements=o,t.closedByOpening={li:{li:!0},p:{p:!0,div:!0},b:{div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0},h1:{h1:!0},h2:{h2:!0},h3:{h3:!0},h4:{h4:!0},h5:{h5:!0},h6:{h6:!0}},t.closedByClosing={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},t.createElement=i,t.createText=function(e,t){return i({nodeType:n.Text,textContent:e,nodeName:"#text",tagName:void 0,tagRange:t})},t.createRange=function(e,t){return[e-a.length+2,t-a.length+2]},t.isBlockText=function(e){return o.map((function(e){return new RegExp("^"+e+"$","i")})).some((function(t){return t.test(e)}))},t.isIgnored=function(e){return o.map((function(e){return new RegExp("^"+e+"$","i")})).some((function(t){return t.test(e)}))}},49:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseString=t.parseHtml=void 0;var r=n(611);function a(e){for(var t=[],n=void 0;n=r.attrRegex.exec(e);){var a=n[1],o=n[3],i="'"===o[0]||'"'===o[0],l={name:a.toLowerCase(),value:i?o.slice(1,o.length-1):o};t.push(l)}return t}function o(e){return void 0===e&&(e=""),e.replace(/\r?\n|\r/g,"").replace(/\s{2,}/g," ").replace(/&nbsp;/," ")||null}t.parseHtml=function(e){for(var t,n=function(e){return void 0===e&&(e=""),e.replace(/<\!--.*?-->/g,"").replace(/^\s*\n/gm,"")}(e),i=r.createElement({tagName:"body",tagRange:[0,n.length]}),l=[i],s=-1,c=void 0,d=n.length;t=r.htmlRegex.exec(n);){var g=t[0],u=t[3],p=t[4],f=t[1],h=t[2];h=h.toLowerCase();var m=g.length,v=r.htmlRegex.lastIndex-m,x=r.htmlRegex.lastIndex,y=r.selfClosingTags.includes(h);if(s>-1&&s+m<x){var b=o(n.substring(s,v));b&&i.childNodes.push(r.createText(b,r.createRange(v,x)))}if(s=r.htmlRegex.lastIndex,!f){var R=a(u),T=i.tagName;!p&&r.closedByOpening[T]&&r.closedByOpening[T][h]&&(l.pop(),i=l[l.length-1]),"a"===h&&(void 0!==c&&(l.splice(c),i=l[l.length-1]),c=l.length);var N=r.htmlRegex.lastIndex,O=N-m,C=r.createElement({tagName:h,nodeType:1,attributes:R,tagRange:r.createRange(O,N)});if(i.childNodes.push(C),i=C,l.push(i),r.isBlockText(h)){var E="</"+h+">",B=h?n.toLocaleLowerCase().indexOf(E,r.htmlRegex.lastIndex):n.indexOf(E,r.htmlRegex.lastIndex),w=-1===B?d:B;if(r.isIgnored(h)){var I=n.substring(N,w).replace(/^\s+|\s+$/g,"");I.length>0&&/\S/.test(I)&&i.childNodes.push(r.createText(I,r.createRange(O,N)))}-1===B?s=r.htmlRegex.lastIndex=n.length+1:(s=r.htmlRegex.lastIndex=B+E.length,f="/")}}if(f||p||y)for(;;){if("a"===h&&(c=void 0),i.tagName===h){i.tagRange[1]=r.createRange(-1,Math.max(s,x))[1],l.pop(),i=l[l.length-1];break}if(T=i.tagName,!r.closedByClosing[T]||!r.closedByClosing[T][h])break;l.pop(),i=l[l.length-1]}}return l},t.parseString=o},642:function(e){e.exports=require("preact")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}var r={};return function(){var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.parse=void 0;var t=n(642),a=n(611),o=n(49);function i(e){var n=e.children,r=void 0===n?[]:n;return t.h(t.Fragment,{},r)}function l(e){var n=this;if(e.nodeType===a.NodeType.Text)return o.parseString(e.textContent);if(e.nodeType!==a.NodeType.Element)return null;var r=String(e.nodeName).toLowerCase(),s=Array.from(e.childNodes),c=function(){return s.map((function(e){return l.call(n,e)}))},d=function(e){var t={};if(!(null==e?void 0:e.length))return t;for(var n=e.length-1;n>=0;n--){var r=e[n];t[r.name]=r.value}return t}(e.attributes);return"script"===r?null:"body"===r?t.h(i,{},c()):t.h(r,d,c())}e.parse=function(e){var t,n="<!DOCTYPE html>\n<html><body>"+e+"</body></html>";if("undefined"==typeof window)return l(o.parseHtml(e)[0]);try{t=(new DOMParser).parseFromString(n,"text/html")}catch(e){}return t?l(t.body):void 0}}(),r}()}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return function(){"use strict";var e={611:function(e,t){var n,r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.isIgnored=t.isBlockText=t.createRange=t.createText=t.createElement=t.frameflag=t.closedByClosing=t.closedByOpening=t.blockTextElements=t.selfClosingTags=t.attrRegex=t.htmlRegex=t.NodeType=void 0,function(e){e[e.Element=1]="Element",e[e.Text=3]="Text"}(n||(n={})),t.NodeType=n,t.htmlRegex=/<!--[\s\S]*?-->|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g,t.attrRegex=/([a-zA-Z\<\>//]){0}\s(?<key>[a-zA-Z|-]+)=?("(?<value>[A-Za-z\d\s?%&=;_:.\-\/\\%]*)")?/gi;var a="documentfragmentcontainer";t.frameflag=a,t.selfClosingTags=["area","base","br","col","hr","img","input","link","meta","source","embed","param","track","wbr"];var o=["script","noscript","style","pre"];function i(e){var t=e.nodeName,a=void 0===t?e.tagName:t,o={nodeName:"BODY",nodeType:n.Element,tagName:"body",tagRange:[],attributes:[],childNodes:[]};return e&&(o=r(r(r({},o),e),{nodeName:a})),o}t.blockTextElements=o,t.closedByOpening={li:{li:!0},p:{p:!0,div:!0},b:{div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0},h1:{h1:!0},h2:{h2:!0},h3:{h3:!0},h4:{h4:!0},h5:{h5:!0},h6:{h6:!0}},t.closedByClosing={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},t.createElement=i,t.createText=function(e,t){return i({nodeType:n.Text,textContent:e,nodeName:"#text",tagName:void 0,tagRange:t})},t.createRange=function(e,t){return[e-a.length+2,t-a.length+2]},t.isBlockText=function(e){return o.map((function(e){return new RegExp("^"+e+"$","i")})).some((function(t){return t.test(e)}))},t.isIgnored=function(e){return o.map((function(e){return new RegExp("^"+e+"$","i")})).some((function(t){return t.test(e)}))}},49:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseString=t.parseHtml=void 0;var r=n(611);function a(e){for(var t=[],n=void 0;n=r.attrRegex.exec(e);){var a=n.groups,o=a.key,i=a.value,l={name:o.toLowerCase(),value:i};t.push(l)}return t}function o(e){return void 0===e&&(e=""),e.replace(/\r?\n|\r/g,"").replace(/\s{2,}/g," ").replace(/&nbsp;/," ")||null}t.parseHtml=function(e){for(var t,n=function(e){return void 0===e&&(e=""),e.replace(/<\!--.*?-->/g,"").replace(/^\s*\n/gm,"")}(e),i=r.createElement({tagName:"body",tagRange:[0,n.length]}),l=[i],s=-1,c=void 0,d=n.length;t=r.htmlRegex.exec(n);){var g=t[0],u=t[3],p=t[4],f=t[1],h=t[2];h=h.toLowerCase();var m=g.length,v=r.htmlRegex.lastIndex-m,x=r.htmlRegex.lastIndex,y=r.selfClosingTags.includes(h);if(s>-1&&s+m<x){var b=o(n.substring(s,v));b&&i.childNodes.push(r.createText(b,r.createRange(v,x)))}if(s=r.htmlRegex.lastIndex,!f){var R=a(u),T=i.tagName;!p&&r.closedByOpening[T]&&r.closedByOpening[T][h]&&(l.pop(),i=l[l.length-1]),"a"===h&&(void 0!==c&&(l.splice(c),i=l[l.length-1]),c=l.length);var N=r.htmlRegex.lastIndex,O=N-m,C=r.createElement({tagName:h,nodeType:1,attributes:R,tagRange:r.createRange(O,N)});if(i.childNodes.push(C),i=C,l.push(i),r.isBlockText(h)){var E="</"+h+">",B=h?n.toLocaleLowerCase().indexOf(E,r.htmlRegex.lastIndex):n.indexOf(E,r.htmlRegex.lastIndex),k=-1===B?d:B;if(r.isIgnored(h)){var w=n.substring(N,k).replace(/^\s+|\s+$/g,"");w.length>0&&/\S/.test(w)&&i.childNodes.push(r.createText(w,r.createRange(O,N)))}-1===B?s=r.htmlRegex.lastIndex=n.length+1:(s=r.htmlRegex.lastIndex=B+E.length,f="/")}}if(f||p||y)for(;;){if("a"===h&&(c=void 0),i.tagName===h){i.tagRange[1]=r.createRange(-1,Math.max(s,x))[1],l.pop(),i=l[l.length-1];break}if(T=i.tagName,!r.closedByClosing[T]||!r.closedByClosing[T][h])break;l.pop(),i=l[l.length-1]}}return l},t.parseString=o},642:function(e){e.exports=require("preact")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}var r={};return function(){var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.parse=void 0;var t=n(642),a=n(611),o=n(49);function i(e){var n=e.children,r=void 0===n?[]:n;return t.h(t.Fragment,{},r)}function l(e){var n=this;if(e.nodeType===a.NodeType.Text)return o.parseString(e.textContent);if(e.nodeType!==a.NodeType.Element)return null;var r=String(e.nodeName).toLowerCase(),s=Array.from(e.childNodes),c=function(){return s.map((function(e){return l.call(n,e)}))},d=function(e){var t={};if(!(null==e?void 0:e.length))return t;for(var n=e.length-1;n>=0;n--){var r=e[n];t[r.name]=r.value}return t}(e.attributes);return"script"===r?null:"body"===r?t.h(i,{},c()):t.h(r,d,c())}e.parse=function(e){var t,n="<!DOCTYPE html>\n<html><body>"+e+"</body></html>";if("undefined"==typeof window)return l(o.parseHtml(e)[0]);try{t=(new DOMParser).parseFromString(n,"text/html")}catch(e){}return t?l(t.body):void 0}}(),r}()}));
{
"name": "preact-parser",
"version": "1.3.5",
"version": "1.3.6",
"repository": "git@github.com:jahilldev/preact-parser.git",

@@ -5,0 +5,0 @@ "author": "James Hill <contact@jameshill.dev>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc