remark-html
Advanced tools
Comparing version 13.0.1 to 13.0.2
22
index.js
@@ -10,7 +10,14 @@ 'use strict' | ||
function plugin(options) { | ||
var settings = options || {} | ||
var clean = settings.sanitize | ||
var schema = clean && typeof clean === 'object' ? clean : null | ||
var handlers = settings.handlers || {} | ||
var settings = Object.assign({}, options || {}) | ||
let clean | ||
if (typeof settings.sanitize === 'boolean') { | ||
clean = settings.sanitize | ||
settings.sanitize = undefined | ||
} | ||
if (typeof clean !== 'boolean') { | ||
clean = true | ||
} | ||
this.Compiler = compiler | ||
@@ -20,3 +27,6 @@ | ||
var root = node && node.type && node.type === 'root' | ||
var hast = toHast(node, {allowDangerousHtml: !clean, handlers: handlers}) | ||
var hast = toHast(node, { | ||
allowDangerousHtml: !clean, | ||
handlers: settings.handlers | ||
}) | ||
var result | ||
@@ -29,3 +39,3 @@ | ||
if (clean) { | ||
hast = sanitize(hast, schema) | ||
hast = sanitize(hast, settings.sanitize) | ||
} | ||
@@ -32,0 +42,0 @@ |
{ | ||
"name": "remark-html", | ||
"version": "13.0.1", | ||
"version": "13.0.2", | ||
"description": "remark plugin to compile Markdown to HTML", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
13017
57