Socket
Socket
Sign inDemoInstall

@tryghost/kg-clean-basic-html

Package Overview
Dependencies
Maintainers
11
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/kg-clean-basic-html - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

6

cjs/clean-basic-html.js

@@ -9,3 +9,5 @@ 'use strict';

if (!options.createDocument) {
if (!DOMParser || (window && !window.DOMParser)) {
const Parser = (typeof DOMParser !== 'undefined' && DOMParser) || (typeof window !== 'undefined' && window.DOMParser);
if (!Parser) {
throw new Error('cleanBasicHtml() must be passed a `createDocument` function as an option when used in a non-browser environment');

@@ -15,3 +17,3 @@ }

options.createDocument = function (html) {
const parser = new (DOMParser || (window && window.DOMParser))();
const parser = new Parser();
return parser.parseFromString(html, 'text/html');

@@ -18,0 +20,0 @@ };

@@ -7,3 +7,5 @@ /* global DOMParser, window */

if (!options.createDocument) {
if (!DOMParser || window && !window.DOMParser) {
const Parser = typeof DOMParser !== 'undefined' && DOMParser || typeof window !== 'undefined' && window.DOMParser;
if (!Parser) {
throw new Error('cleanBasicHtml() must be passed a `createDocument` function as an option when used in a non-browser environment');

@@ -13,3 +15,3 @@ }

options.createDocument = function (html) {
const parser = new (DOMParser || window && window.DOMParser)();
const parser = new Parser();
return parser.parseFromString(html, 'text/html');

@@ -16,0 +18,0 @@ };

@@ -7,3 +7,5 @@ /* global DOMParser, window */

if (!options.createDocument) {
if (!DOMParser || (window && !window.DOMParser)) {
const Parser = (typeof DOMParser !== 'undefined' && DOMParser) || (typeof window !== 'undefined' && window.DOMParser);
if (!Parser) {
throw new Error('cleanBasicHtml() must be passed a `createDocument` function as an option when used in a non-browser environment');

@@ -13,3 +15,3 @@ }

options.createDocument = function (html) {
const parser = new (DOMParser || (window && window.DOMParser))();
const parser = new Parser();
return parser.parseFromString(html, 'text/html');

@@ -16,0 +18,0 @@ };

{
"name": "@tryghost/kg-clean-basic-html",
"version": "0.1.0",
"version": "0.1.1",
"repository": "https://github.com/TryGhost/Koenig/tree/master/packages/kg-clean-basic-html",

@@ -39,3 +39,3 @@ "author": "Ghost Foundation",

},
"gitHead": "2d7cb5a6473209823964068740b1e3d334f5cfa0"
"gitHead": "7e077269871e47be21186ee0b19c7b954cb80791"
}

Sorry, the diff of this file is not supported yet

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