Package Exports
- hast-util-to-html
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hast-util-to-html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hast-util-to-html

Transform HAST to HTML.
Installation
npm:
npm install hast-util-to-html
Usage
Dependencies:
var h = require('hastscript');
var toHTML = require('hast-util-to-html');
Transform:
var tree = h('.alpha', [
'bravo ',
h('b', 'charlie'),
' delta ',
h('a.echo', {
download: true
}, 'foxtrot')
]);
Yields:
<div class="alpha">bravo <b>charlie</b> delta <a class="echo" download>foxtrot</a></div>
API
toHTML(node[, options])
Stringify the given HAST tree.
Parameters
node
(HASTNode
).options
(object
, optional):allowDangerousHTML
(boolean
, default:false
) — Whether to allowraw
nodes and insert them as raw HTML. When falsey, encodesraw
nodes.entities
(Object
, default:{escapeOnly: true}
) — configuration forstringify-entities
.voids
(Array.<string>
, default:html-void-elements
) — Tag-names of elements to stringify without closing tag.closeSelfClosing
(boolean
, default:false
) Whether to close self-closing nodes with an extra, superfluous slash (/
):<img />
instead of<img>
.
Returns
string
.