@yozora/html-delete
v2.0.0-alpha.2
Published
render Yozora Markdown AST node `IDelete` into HTML string
Downloads
27
Maintainers
Readme
This component is for rendering the Yozora Markdown AST node [IDelete
][@yozora/ast]
produced by [@yozora/tokenizer-delete][] into HTML string.
This component has been built into [@yozora/html-markdown][], you can use it directly.
Install
npm
npm install --save @yozora/html-delete
yarn
yarn add @yozora/html-delete
Usage
Basic:
import type { IDelete, IYastNode } from '@yozora/ast' import renderDelete from '@yozora/html-delete' // The implementation of the following function has been omitted. const renderChildren: (nodes: IYastNode[]) => string = function () {} const node = { "type": "delete", "children": [ { "type": "text", "value": "yozora is cool!" } ]
} renderDelete(node as Delete, renderChildren) // => yozora is cool!
## Related
* [@yozora/ast][]
* [@yozora/react-markdown][]
* [@yozora/react-delete][]
* [@yozora/tokenizer-delete][]
* [Delete | Mdast][mdast]
[@yozora/ast]: https://www.npmjs.com/package/@yozora/ast#delete
[@yozora/react-markdown]: https://www.npmjs.com/package/@yozora/react-markdown
[@yozora/tokenizer-delete]: https://www.npmjs.com/package/@yozora/tokenizer-delete
[@yozora/react-delete]: https://www.npmjs.com/package/@yozora/react-delete
[mdast]: https://github.com/syntax-tree/mdast#delete