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