mdast-util-to-hast
Advanced tools
Comparing version 8.0.0 to 8.1.0
@@ -28,2 +28,3 @@ 'use strict' | ||
h.handlers = Object.assign({}, handlers, settings.handlers) | ||
h.unknownHandler = settings.unknownHandler | ||
@@ -30,0 +31,0 @@ visit(tree, 'footnoteDefinition', onfootnotedefinition) |
@@ -22,3 +22,3 @@ 'use strict' | ||
var type = node && node.type | ||
var fn = own.call(h.handlers, type) ? h.handlers[type] : null | ||
var fn = own.call(h.handlers, type) ? h.handlers[type] : h.unknownHandler | ||
@@ -25,0 +25,0 @@ // Fail on non-nodes. |
{ | ||
"name": "mdast-util-to-hast", | ||
"version": "8.0.0", | ||
"version": "8.1.0", | ||
"description": "mdast utility to transform to hast", | ||
@@ -50,3 +50,3 @@ "license": "MIT", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.26.0" | ||
"xo": "^0.27.0" | ||
}, | ||
@@ -53,0 +53,0 @@ "scripts": { |
@@ -79,3 +79,3 @@ # mdast-util-to-hast | ||
are found. | ||
The default behaviour is to prefer the last duplicate definition. | ||
The default behavior is to prefer the last duplicate definition. | ||
@@ -87,2 +87,11 @@ ###### `options.handlers` | ||
###### `options.unknownHandler` | ||
Handler for all unknown nodes. | ||
Default behavior: | ||
* Unknown nodes with [`children`][child] are transformed to `div` elements | ||
* Unknown nodes with `value` are transformed to [`text`][hast-text] nodes | ||
##### Returns | ||
@@ -98,4 +107,2 @@ | ||
* [`position`][position]s are properly patched | ||
* Unknown nodes with [`children`][child] are transformed to `div` elements | ||
* Unknown nodes with `value` are transformed to [`text`][hast-text] nodes | ||
* [`node.data.hName`][hname] configures the hast element’s tag-name | ||
@@ -283,7 +290,9 @@ * [`node.data.hProperties`][hproperties] is mixed into the hast element’s | ||
* [`mdast-util-to-nlcst`](https://github.com/syntax-tree/mdast-util-to-nlcst) | ||
— Transform mdast to nlcst | ||
— transform mdast to nlcst | ||
* [`hast-util-to-mdast`](https://github.com/syntax-tree/hast-util-to-mdast) | ||
— transform hast to mdast | ||
* [`hast-util-to-xast`](https://github.com/syntax-tree/hast-util-to-xast) | ||
— transform hast to xast | ||
* [`hast-util-sanitize`](https://github.com/syntax-tree/hast-util-sanitize) | ||
— Sanitize hast nodes | ||
* [`hast-util-to-mdast`](https://github.com/syntax-tree/hast-util-to-mdast) | ||
— Transform hast to mdast | ||
— sanitize hast nodes | ||
* [`remark-rehype`](https://github.com/remarkjs/remark-rehype) | ||
@@ -290,0 +299,0 @@ — rehype support for remark |
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
29647
626
396