planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

2
node_modules/mdast-util-to-hast/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
'use strict'
module.exports = require('./lib')

37
node_modules/mdast-util-to-hast/lib/all.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
'use strict'
module.exports = all
var trim = require('trim')
var one = require('./one')
function all(h, parent) {
var nodes = parent.children || []
var length = nodes.length
var values = []
var index = -1
var result
var head
while (++index < length) {
result = one(h, nodes[index], parent)
if (result) {
if (index && nodes[index - 1].type === 'break') {
if (result.value) {
result.value = trim.left(result.value)
}
head = result.children && result.children[0]
if (head && head.value) {
head.value = trim.left(head.value)
}
}
values = values.concat(result)
}
}
return values
}

61
node_modules/mdast-util-to-hast/lib/footer.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
'use strict'
module.exports = generateFootnotes
var thematicBreak = require('./handlers/thematic-break')
var list = require('./handlers/list')
var wrap = require('./wrap')
function generateFootnotes(h) {
var footnotes = h.footnotes
var length = footnotes.length
var index = -1
var listItems = []
var def
var backReference
var content
var tail
if (!length) {
return null
}
while (++index < length) {
def = footnotes[index]
content = def.children.concat()
tail = content[content.length - 1]
backReference = {
type: 'link',
url: '#fnref-' + def.identifier,
data: {hProperties: {className: ['footnote-backref']}},
children: [{type: 'text', value: '↩'}]
}
if (!tail || tail.type !== 'paragraph') {
tail = {type: 'paragraph', children: []}
content.push(tail)
}
tail.children.push(backReference)
listItems[index] = {
type: 'listItem',
data: {hProperties: {id: 'fn-' + def.identifier}},
children: content,
position: def.position
}
}
return h(
null,
'div',
{className: ['footnotes']},
wrap(
[
thematicBreak(h),
list(h, {type: 'list', ordered: true, children: listItems})
],
true
)
)
}

View File

@@ -0,0 +1,10 @@
'use strict'
module.exports = blockquote
var wrap = require('../wrap')
var all = require('../all')
function blockquote(h, node) {
return h(node, 'blockquote', wrap(all(h, node), true))
}

View File

@@ -0,0 +1,9 @@
'use strict'
module.exports = hardBreak
var u = require('unist-builder')
function hardBreak(h, node) {
return [h(node, 'br'), u('text', '\n')]
}

18
node_modules/mdast-util-to-hast/lib/handlers/code.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict'
module.exports = code
var detab = require('detab')
var u = require('unist-builder')
function code(h, node) {
var value = node.value ? detab(node.value + '\n') : ''
var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/)
var props = {}
if (lang) {
props.className = ['language-' + lang]
}
return h(node.position, 'pre', [h(node, 'code', props, [u('text', value)])])
}

View File

@@ -0,0 +1,9 @@
'use strict'
module.exports = strikethrough
var all = require('../all')
function strikethrough(h, node) {
return h(node, 'del', all(h, node))
}

View File

@@ -0,0 +1,9 @@
'use strict'
module.exports = emphasis
var all = require('../all')
function emphasis(h, node) {
return h(node, 'em', all(h, node))
}

View File

@@ -0,0 +1,15 @@
'use strict'
module.exports = footnoteReference
var u = require('unist-builder')
function footnoteReference(h, node) {
var identifier = node.identifier
return h(node.position, 'sup', {id: 'fnref-' + identifier}, [
h(node, 'a', {href: '#fn-' + identifier, className: ['footnote-ref']}, [
u('text', identifier)
])
])
}

View File

@@ -0,0 +1,36 @@
'use strict'
module.exports = footnote
var footnoteReference = require('./footnote-reference')
function footnote(h, node) {
var identifiers = []
var identifier = 1
var footnotes = h.footnotes
var length = footnotes.length
var index = -1
while (++index < length) {
identifiers[index] = footnotes[index].identifier
}
while (identifiers.indexOf(String(identifier)) !== -1) {
identifier++
}
identifier = String(identifier)
footnotes.push({
type: 'footnoteDefinition',
identifier: identifier,
children: [{type: 'paragraph', children: node.children}],
position: node.position
})
return footnoteReference(h, {
type: 'footnoteReference',
identifier: identifier,
position: node.position
})
}

View File

@@ -0,0 +1,9 @@
'use strict'
module.exports = heading
var all = require('../all')
function heading(h, node) {
return h(node, 'h' + node.depth, all(h, node))
}

10
node_modules/mdast-util-to-hast/lib/handlers/html.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
'use strict'
module.exports = html
var u = require('unist-builder')
// Return either a `raw` node, in dangerous mode, or nothing.
function html(h, node) {
return h.dangerous ? h.augment(node, u('raw', node.value)) : null
}

View File

@@ -0,0 +1,23 @@
'use strict'
module.exports = imageReference
var normalize = require('mdurl/encode')
var revert = require('../revert')
function imageReference(h, node) {
var def = h.definition(node.identifier)
var props
if (!def) {
return revert(h, node)
}
props = {src: normalize(def.url || ''), alt: node.alt}
if (def.title !== null && def.title !== undefined) {
props.title = def.title
}
return h(node, 'img', props)
}

15
node_modules/mdast-util-to-hast/lib/handlers/image.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict'
var normalize = require('mdurl/encode')
module.exports = image
function image(h, node) {
var props = {src: normalize(node.url), alt: node.alt}
if (node.title !== null && node.title !== undefined) {
props.title = node.title
}
return h(node, 'img', props)
}

35
node_modules/mdast-util-to-hast/lib/handlers/index.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
'use strict'
module.exports = {
blockquote: require('./blockquote'),
break: require('./break'),
code: require('./code'),
delete: require('./delete'),
emphasis: require('./emphasis'),
footnoteReference: require('./footnote-reference'),
footnote: require('./footnote'),
heading: require('./heading'),
html: require('./html'),
imageReference: require('./image-reference'),
image: require('./image'),
inlineCode: require('./inline-code'),
linkReference: require('./link-reference'),
link: require('./link'),
listItem: require('./list-item'),
list: require('./list'),
paragraph: require('./paragraph'),
root: require('./root'),
strong: require('./strong'),
table: require('./table'),
text: require('./text'),
thematicBreak: require('./thematic-break'),
toml: ignore,
yaml: ignore,
definition: ignore,
footnoteDefinition: ignore
}
// Return nothing for nodes which are ignored.
function ignore() {
return null
}

View File

@@ -0,0 +1,10 @@
'use strict'
module.exports = inlineCode
var collapse = require('collapse-white-space')
var u = require('unist-builder')
function inlineCode(h, node) {
return h(node, 'code', [u('text', collapse(node.value))])
}

View File

@@ -0,0 +1,24 @@
'use strict'
module.exports = linkReference
var normalize = require('mdurl/encode')
var revert = require('../revert')
var all = require('../all')
function linkReference(h, node) {
var def = h.definition(node.identifier)
var props
if (!def) {
return revert(h, node)
}
props = {href: normalize(def.url || '')}
if (def.title !== null && def.title !== undefined) {
props.title = def.title
}
return h(node, 'a', props, all(h, node))
}

16
node_modules/mdast-util-to-hast/lib/handlers/link.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
'use strict'
var normalize = require('mdurl/encode')
var all = require('../all')
module.exports = link
function link(h, node) {
var props = {href: normalize(node.url)}
if (node.title !== null && node.title !== undefined) {
props.title = node.title
}
return h(node, 'a', props, all(h, node))
}

View File

@@ -0,0 +1,89 @@
'use strict'
module.exports = listItem
var u = require('unist-builder')
var wrap = require('../wrap')
var all = require('../all')
function listItem(h, node, parent) {
var children = node.children
var head = children[0]
var raw = all(h, node)
var loose = parent ? listLoose(parent) : listItemLoose(node)
var props = {}
var result
var container
var index
var length
var child
/* Tight lists should not render 'paragraph' nodes as 'p' tags */
if (loose) {
result = raw
} else {
result = []
length = raw.length
index = -1
while (++index < length) {
child = raw[index]
if (child.tagName === 'p') {
result = result.concat(child.children)
} else {
result.push(child)
}
}
}
if (typeof node.checked === 'boolean') {
if (loose && (!head || head.type !== 'paragraph')) {
result.unshift(h(null, 'p', []))
}
container = loose ? result[0].children : result
if (container.length !== 0) {
container.unshift(u('text', ' '))
}
container.unshift(
h(null, 'input', {
type: 'checkbox',
checked: node.checked,
disabled: true
})
)
// According to github-markdown-css, this class hides bullet.
props.className = ['task-list-item']
}
if (loose && result.length !== 0) {
result = wrap(result, true)
}
return h(node, 'li', props, result)
}
function listLoose(node) {
var loose = node.spread
var children = node.children
var length = children.length
var index = -1
while (!loose && ++index < length) {
loose = listItemLoose(children[index])
}
return loose
}
function listItemLoose(node) {
var spread = node.spread
return spread === undefined || spread === null
? node.children.length > 1
: spread
}

17
node_modules/mdast-util-to-hast/lib/handlers/list.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
'use strict'
module.exports = list
var wrap = require('../wrap')
var all = require('../all')
function list(h, node) {
var props = {}
var name = node.ordered ? 'ol' : 'ul'
if (typeof node.start === 'number' && node.start !== 1) {
props.start = node.start
}
return h(node, name, props, wrap(all(h, node), true))
}

View File

@@ -0,0 +1,9 @@
'use strict'
module.exports = paragraph
var all = require('../all')
function paragraph(h, node) {
return h(node, 'p', all(h, node))
}

11
node_modules/mdast-util-to-hast/lib/handlers/root.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
'use strict'
module.exports = root
var u = require('unist-builder')
var wrap = require('../wrap')
var all = require('../all')
function root(h, node) {
return h.augment(node, u('root', wrap(all(h, node))))
}

View File

@@ -0,0 +1,9 @@
'use strict'
module.exports = strong
var all = require('../all')
function strong(h, node) {
return h(node, 'strong', all(h, node))
}

53
node_modules/mdast-util-to-hast/lib/handlers/table.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
'use strict'
module.exports = table
var position = require('unist-util-position')
var wrap = require('../wrap')
var all = require('../all')
function table(h, node) {
var rows = node.children
var index = rows.length
var align = node.align
var alignLength = align.length
var result = []
var pos
var row
var out
var name
var cell
while (index--) {
row = rows[index].children
name = index === 0 ? 'th' : 'td'
pos = alignLength
out = []
while (pos--) {
cell = row[pos]
out[pos] = h(cell, name, {align: align[pos]}, cell ? all(h, cell) : [])
}
result[index] = h(rows[index], 'tr', wrap(out, true))
}
return h(
node,
'table',
wrap(
[
h(result[0].position, 'thead', wrap([result[0]], true)),
h(
{
start: position.start(result[1]),
end: position.end(result[result.length - 1])
},
'tbody',
wrap(result.slice(1), true)
)
],
true
)
)
}

10
node_modules/mdast-util-to-hast/lib/handlers/text.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
'use strict'
module.exports = text
var u = require('unist-builder')
var trimLines = require('trim-lines')
function text(h, node) {
return h.augment(node, u('text', trimLines(node.value)))
}

View File

@@ -0,0 +1,7 @@
'use strict'
module.exports = thematicBreak
function thematicBreak(h, node) {
return h(node, 'hr')
}

99
node_modules/mdast-util-to-hast/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,99 @@
'use strict'
module.exports = toHast
var xtend = require('xtend')
var u = require('unist-builder')
var visit = require('unist-util-visit')
var position = require('unist-util-position')
var generated = require('unist-util-generated')
var definitions = require('mdast-util-definitions')
var one = require('./one')
var footer = require('./footer')
var handlers = require('./handlers')
// Factory to transform.
function factory(tree, options) {
var settings = options || {}
var dangerous = settings.allowDangerousHTML
h.dangerous = dangerous
h.definition = definitions(tree, settings)
h.footnotes = []
h.augment = augment
h.handlers = xtend(handlers, settings.handlers || {})
visit(tree, 'footnoteDefinition', visitor)
return h
// Finalise the created `right`, a hast node, from `left`, an mdast node.
function augment(left, right) {
var data
var ctx
// Handle `data.hName`, `data.hProperties, `hChildren`.
if (left && 'data' in left) {
data = left.data
if (right.type === 'element' && data.hName) {
right.tagName = data.hName
}
if (right.type === 'element' && data.hProperties) {
right.properties = xtend(right.properties, data.hProperties)
}
if (right.children && data.hChildren) {
right.children = data.hChildren
}
}
ctx = left && left.position ? left : {position: left}
if (!generated(ctx)) {
right.position = {
start: position.start(ctx),
end: position.end(ctx)
}
}
return right
}
// Create an element for a `node`.
function h(node, tagName, props, children) {
if (
(children === undefined || children === null) &&
typeof props === 'object' &&
'length' in props
) {
children = props
props = {}
}
return augment(node, {
type: 'element',
tagName: tagName,
properties: props || {},
children: children || []
})
}
function visitor(definition) {
h.footnotes.push(definition)
}
}
// Transform `tree`, which is an mdast node, to a hast node.
function toHast(tree, options) {
var h = factory(tree, options)
var node = one(h, tree)
var footnotes = footer(h)
if (node && node.children && footnotes) {
node.children = node.children.concat(u('text', '\n'), footnotes)
}
return node
}

45
node_modules/mdast-util-to-hast/lib/one.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
'use strict'
module.exports = one
var u = require('unist-builder')
var all = require('./all')
var own = {}.hasOwnProperty
// Transform an unknown node.
function unknown(h, node) {
if (text(node)) {
return h.augment(node, u('text', node.value))
}
return h(node, 'div', all(h, node))
}
// Visit a node.
function one(h, node, parent) {
var type = node && node.type
var fn = own.call(h.handlers, type) ? h.handlers[type] : null
// Fail on non-nodes.
if (!type) {
throw new Error('Expected node, got `' + node + '`')
}
return (typeof fn === 'function' ? fn : unknown)(h, node, parent)
}
// Check if the node should be renderered a text node.
function text(node) {
var data = node.data || {}
if (
own.call(data, 'hName') ||
own.call(data, 'hProperties') ||
own.call(data, 'hChildren')
) {
return false
}
return 'value' in node
}

44
node_modules/mdast-util-to-hast/lib/revert.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
'use strict'
module.exports = revert
var u = require('unist-builder')
var all = require('./all')
// Return the content of a reference without definition as markdown.
function revert(h, node) {
var subtype = node.referenceType
var suffix = ']'
var contents
var head
var tail
if (subtype === 'collapsed') {
suffix += '[]'
} else if (subtype === 'full') {
suffix += '[' + (node.label || node.identifier) + ']'
}
if (node.type === 'imageReference') {
return u('text', '![' + node.alt + suffix)
}
contents = all(h, node)
head = contents[0]
if (head && head.type === 'text') {
head.value = '[' + head.value
} else {
contents.unshift(u('text', '['))
}
tail = contents[contents.length - 1]
if (tail && tail.type === 'text') {
tail.value += suffix
} else {
contents.push(u('text', suffix))
}
return contents
}

31
node_modules/mdast-util-to-hast/lib/wrap.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
'use strict'
module.exports = wrap
var u = require('unist-builder')
// Wrap `nodes` with newlines between each entry. Optionally adds newlines at
// the start and end.
function wrap(nodes, loose) {
var result = []
var index = -1
var length = nodes.length
if (loose) {
result.push(u('text', '\n'))
}
while (++index < length) {
if (index) {
result.push(u('text', '\n'))
}
result.push(nodes[index])
}
if (loose && nodes.length !== 0) {
result.push(u('text', '\n'))
}
return result
}

22
node_modules/mdast-util-to-hast/license generated vendored Normal file
View File

@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

84
node_modules/mdast-util-to-hast/package.json generated vendored Normal file
View File

@@ -0,0 +1,84 @@
{
"name": "mdast-util-to-hast",
"version": "4.0.0",
"description": "Transform mdast to hast",
"license": "MIT",
"keywords": [
"mdast",
"util",
"hast"
],
"repository": "syntax-tree/mdast-util-to-hast",
"bugs": "https://github.com/syntax-tree/mdast-util-to-hast/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"files": [
"lib",
"index.js"
],
"dependencies": {
"collapse-white-space": "^1.0.0",
"detab": "^2.0.0",
"mdast-util-definitions": "^1.2.0",
"mdurl": "^1.0.1",
"trim": "0.0.1",
"trim-lines": "^1.0.0",
"unist-builder": "^1.0.1",
"unist-util-generated": "^1.1.0",
"unist-util-position": "^3.0.0",
"unist-util-visit": "^1.1.0",
"xtend": "^4.0.1"
},
"devDependencies": {
"browserify": "^16.0.0",
"nyc": "^13.0.0",
"prettier": "^1.13.3",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^4.0.0",
"tape": "^4.0.0",
"tinyify": "^2.4.3",
"xo": "^0.23.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix",
"build-bundle": "browserify index.js -s mdastUtilToHast > mdast-util-to-hast.js",
"build-mangle": "browserify index.js -s mdastUtilToHast -p tinyify > mdast-util-to-hast.min.js",
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test/index.js",
"test": "npm run format && npm run build && npm run test-coverage"
},
"nyc": {
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"no-var": "off",
"prefer-arrow-callback": "off",
"guard-for-in": "off"
},
"ignores": [
"mdast-util-to-hast.js"
]
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
}
}

268
node_modules/mdast-util-to-hast/readme.md generated vendored Normal file
View File

@@ -0,0 +1,268 @@
# mdast-util-to-hast
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Chat][chat-badge]][chat]
Transform [mdast][] to [hast][].
> **Note**: You probably want to use [remark-rehype][].
## Installation
[npm][]:
```bash
npm install mdast-util-to-hast
```
## Usage
Say we have the following `example.md`:
```markdown
## Hello **World**!
```
…and next to it, `example.js`:
```javascript
var inspect = require('unist-util-inspect')
var unified = require('unified')
var parse = require('remark-parse')
var vfile = require('to-vfile')
var toHast = require('mdast-util-to-hast')
var tree = unified()
.use(parse)
.parse(vfile.readSync('example.md'))
console.log(inspect(toHast(tree)))
```
Which when running with `node example` yields:
```txt
root[1] (1:1-2:1, 0-20)
└─ element[3] (1:1-1:20, 0-19) [tagName="h2"]
├─ text: "Hello " (1:4-1:10, 3-9)
├─ element[1] (1:10-1:19, 9-18) [tagName="strong"]
│ └─ text: "World" (1:12-1:17, 11-16)
└─ text: "!" (1:19-1:20, 18-19)
```
## API
### `toHast(node[, options])`
Transform the given [mdast][] tree to a [hast][] tree.
##### Options
###### `options.allowDangerousHTML`
Whether to allow `html` nodes and inject them as raw HTML (`boolean`, default:
`false`). Only do this when compiling later with `hast-util-to-html`.
###### `options.commonmark`
Set to `true` (default: `false`) to prefer the first when duplicate definitions
are found. The default behaviour is to prefer the last duplicate definition.
###### `options.handlers`
Object mapping [mdast nodes][mdast] to functions handling those elements.
Take a look at [`lib/handlers/`][handlers] for examples.
##### Returns
[`HASTNode`][hast].
##### Notes
* `yaml` and `toml` nodes are ignored
* [`html`][mdast-html] nodes are ignored if `allowDangerousHTML` is `false`
* [`position`][unist-position]s are properly patched
* Unknown nodes with `children` are transformed to `div` elements
* Unknown nodes with `value` are transformed to `text` nodes
* [`node.data.hName`][hname] configures the hast elements tag-name
* [`node.data.hProperties`][hproperties] is mixed into the hast elements
properties
* [`node.data.hChildren`][hchildren] configures the hast elements children
##### Examples
###### `hName`
`node.data.hName` sets the tag-name of an element.
The following [mdast][]:
```js
{
type: 'strong',
data: {hName: 'b'},
children: [{type: 'text', value: 'Alpha'}]
}
```
Yields, in [hast][]:
```js
{
type: 'element',
tagName: 'b',
properties: {},
children: [{type: 'text', value: 'Alpha'}]
}
```
###### `hProperties`
`node.data.hProperties` in sets the properties of an element.
The following [mdast][]:
```js
{
type: 'image',
src: 'circle.svg',
alt: 'Big red circle on a black background',
title: null
data: {hProperties: {className: ['responsive']}}
}
```
Yields, in [hast][]:
```js
{
type: 'element',
tagName: 'img',
properties: {
src: 'circle.svg',
alt: 'Big red circle on a black background',
className: ['responsive']
},
children: []
}
```
###### `hChildren`
`node.data.hChildren` sets the children of an element.
The following [mdast][]:
```js
{
type: 'code',
lang: 'js',
data: {
hChildren: [
{
type: 'element',
tagName: 'span',
properties: {className: ['hljs-meta']},
children: [{type: 'text', value: '"use strict"'}]
},
{type: 'text', value: ';'}
]
},
value: '"use strict";'
}
```
Yields, in [hast][] (**note**: the `pre` and `language-js` class are normal
`mdast-util-to-hast` functionality):
```js
{
type: 'element',
tagName: 'pre',
properties: {},
children: [{
type: 'element',
tagName: 'code',
properties: {className: ['language-js']},
children: [
{
type: 'element',
tagName: 'span',
properties: {className: ['hljs-meta']},
children: [{type: 'text', value: '"use strict"'}]
},
{type: 'text', value: ';'}
]
}]
}
```
## Related
* [`mdast-util-to-nlcst`](https://github.com/syntax-tree/mdast-util-to-nlcst)
— Transform mdast to nlcst
* [`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
* [`remark-rehype`](https://github.com/remarkjs/remark-rehype)
— rehype support for remark
* [`rehype-remark`](https://github.com/rehypejs/rehype-remark)
— remark support for rehype
## Contribute
See [`contributing.md` in `syntax-tree/mdast`][contributing] for ways to get
started.
This organisation has a [Code of Conduct][coc]. By interacting with this
repository, organisation, or community you agree to abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://img.shields.io/travis/syntax-tree/mdast-util-to-hast.svg
[build]: https://travis-ci.org/syntax-tree/mdast-util-to-hast
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-hast.svg
[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-hast
[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-hast.svg
[downloads]: https://www.npmjs.com/package/mdast-util-to-hast
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[chat]: https://spectrum.chat/unified/remark
[npm]: https://docs.npmjs.com/cli/install
[license]: license
[author]: https://wooorm.com
[mdast]: https://github.com/syntax-tree/mdast
[hast]: https://github.com/syntax-tree/hast
[mdast-html]: https://github.com/syntax-tree/mdast#html
[unist-position]: https://github.com/syntax-tree/unist#location
[handlers]: lib/handlers
[remark-rehype]: https://github.com/remarkjs/remark-rehype
[contributing]: https://github.com/syntax-tree/mdast/blob/master/contributing.md
[coc]: https://github.com/syntax-tree/mdast/blob/master/code-of-conduct.md
[hname]: #hname
[hproperties]: #hproperties
[hchildren]: #hchildren