mdast-util-to-hast
Advanced tools
Comparing version 8.1.0 to 8.2.0
@@ -16,6 +16,17 @@ 'use strict' | ||
var deprecationWarningIssued = false | ||
// Factory to transform. | ||
function factory(tree, options) { | ||
var settings = options || {} | ||
var dangerous = settings.allowDangerousHTML | ||
// Issue a warning if the deprecated tag 'allowDangerousHTML' is used | ||
if (settings.allowDangerousHTML !== undefined && !deprecationWarningIssued) { | ||
deprecationWarningIssued = true | ||
console.warn( | ||
'mdast-util-to-hast: deprecation: `allowDangerousHTML` is nonstandard, use `allowDangerousHtml` instead' | ||
) | ||
} | ||
var dangerous = settings.allowDangerousHtml || settings.allowDangerousHTML | ||
var footnoteById = {} | ||
@@ -22,0 +33,0 @@ |
{ | ||
"name": "mdast-util-to-hast", | ||
"version": "8.1.0", | ||
"version": "8.2.0", | ||
"description": "mdast utility to transform to hast", | ||
@@ -45,8 +45,8 @@ "license": "MIT", | ||
"nyc": "^15.0.0", | ||
"prettier": "^1.0.0", | ||
"remark-cli": "^7.0.0", | ||
"remark-preset-wooorm": "^6.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^8.0.0", | ||
"remark-preset-wooorm": "^7.0.0", | ||
"tape": "^4.0.0", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.27.0" | ||
"xo": "^0.28.0" | ||
}, | ||
@@ -53,0 +53,0 @@ "scripts": { |
@@ -66,3 +66,3 @@ # mdast-util-to-hast | ||
###### `options.allowDangerousHTML` | ||
###### `options.allowDangerousHtml` | ||
@@ -104,3 +104,3 @@ Whether to allow [`html`][mdast-html] nodes and inject them as raw HTML | ||
[`remark-frontmatter`][remark-frontmatter]) | ||
* [`html`][mdast-html] nodes are ignored if `allowDangerousHTML` is `false` | ||
* [`html`][mdast-html] nodes are ignored if `allowDangerousHtml` is `false` | ||
* [`position`][position]s are properly patched | ||
@@ -222,3 +222,3 @@ * [`node.data.hName`][hname] configures the hast element’s tag-name | ||
Embedded hast properties (`hName`, `hProperties`, `hChildren`), custom handlers, | ||
and the `allowDangerousHTML` option all provide openings. | ||
and the `allowDangerousHtml` option all provide openings. | ||
@@ -269,3 +269,3 @@ The following example shows how a script is injected where a benign code block | ||
Passing `allowDangerousHTML: true` to `mdast-util-to-hast` is typically still | ||
Passing `allowDangerousHtml: true` to `mdast-util-to-hast` is typically still | ||
not enough to run unsafe code: | ||
@@ -278,3 +278,3 @@ | ||
If `allowDangerousHTML: true` is also given to `hast-util-to-html` (or | ||
If `allowDangerousHtml: true` is also given to `hast-util-to-html` (or | ||
`rehype-stringify`), the unsafe code runs: | ||
@@ -281,0 +281,0 @@ |
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
30045
634