@yozora/html-blockquote
v2.0.0-alpha.2
Published
render Yozora Markdown AST node `IBlockquote` into HTML string
Downloads
14
Maintainers
Readme
This component is for rendering the Yozora Markdown AST node IBlockquote
produced by @yozora/tokenizer-blockquote into HTML string.
This component has been built into [@yozora/html-markdown][], you can use it directly.
Install
npm
npm install --save @yozora/html-blockquote
yarn
yarn add @yozora/html-blockquote
Usage
Basic:
import type { IBlockquote, IYastNode } from '@yozora/ast' import renderBlockquote from '@yozora/html-blockquote' // The implementation of the following function has been omitted. const renderChildren: (nodes: IYastNode[]) => string = function () {} const blockquote = { "type": "blockquote", "children": [ { "type": "text", "value": "yozora is cool!" } ] } renderBlockquote(blockquote as IBlockquote, renderChildren) // => <blockquote class="yozora-blockquote"><span class="yozora-text">yozora is cool!</span></blockquote>