Socket
Socket
Sign inDemoInstall

@tryghost/kg-parser-plugins

Package Overview
Dependencies
Maintainers
11
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 0.4.1

6

cjs/parser-plugins.js

@@ -14,3 +14,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('createParserPlugins() must be passed a `createDocument` function as an option when used in a non-browser environment');

@@ -20,3 +22,3 @@ }

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

@@ -23,0 +25,0 @@ };

@@ -9,3 +9,5 @@ import cleanBasicHtml from '@tryghost/kg-clean-basic-html';

if (!options.createDocument) {
if (!DOMParser || window && !window.DOMParser) {
const Parser = typeof DOMParser !== 'undefined' && DOMParser || typeof window !== 'undefined' && window.DOMParser;
if (!Parser) {
throw new Error('createParserPlugins() 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 @@ };

@@ -19,3 +19,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('createParserPlugins() must be passed a `createDocument` function as an option when used in a non-browser environment');

@@ -25,3 +27,3 @@ }

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

@@ -28,0 +30,0 @@ };

{
"name": "@tryghost/kg-parser-plugins",
"version": "0.4.0",
"version": "0.4.1",
"repository": "https://github.com/TryGhost/Ghost-SDK/tree/master/packages/kg-parser-plugins",

@@ -41,5 +41,5 @@ "author": "Ghost Foundation",

"dependencies": {
"@tryghost/kg-clean-basic-html": "^0.1.0"
"@tryghost/kg-clean-basic-html": "^0.1.1"
},
"gitHead": "82fc89a5999e3915df9d5dc0792c860370030b7a"
"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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc