2.0.0-alpha.2 • Published 2 years ago
@yozora/html-emphasis v2.0.0-alpha.2
This component is for rendering the Yozora Markdown AST node IEmphasis
produced by @yozora/tokenizer-emphasis into HTML string.
This component has been built into @yozora/html-markdown, you can use it directly.
Install
npm
npm install --save @yozora/html-emphasis
yarn
yarn add @yozora/html-emphasis
Usage
Basic:
import type { IEmphasis, IYastNode } from '@yozora/ast' import renderEmphasis from '@yozora/html-emphasis' // The implementation of the following function has been omitted. const renderChildren: (nodes: IYastNode[]) => string = function () {} const emphasis = { "type": "emphasis", "children": [ { "type": "text", "value": "yozora is cool!" } ] } renderEmphasis(emphasis as IEmphasis, renderChildren) // => <em class="yozora-emphasis"><span class="yozora-text">yozora is cool!</span></em>
Related
2.0.0-alpha.0
2 years ago
2.0.0-alpha.1
2 years ago
2.0.0-alpha.2
2 years ago
1.0.0-alpha.4
3 years ago
1.0.0-alpha.3
3 years ago
1.0.0-alpha.2
3 years ago
1.0.0-alpha.1
3 years ago
1.0.0-alpha.0
3 years ago