@yozora/html-image
v2.0.0-alpha.2
Published
render Yozora Markdown AST node `IImage` into HTML string
Downloads
12
Readme
This component is for rendering the Yozora Markdown AST node IImage
produced by @yozora/tokenizer-image into HTML string.
This component has been built into [@yozora/html-markdown][], you can use it directly.
Install
npm
npm install --save @yozora/html-image
yarn
yarn add @yozora/html-image
Usage
Basic:
import type { IImage } from '@yozora/ast' import renderImage from '@yozora/html-image' const image: IImage = { "type": "image", "url": "https://github.com/favicon.svg/", "alt": "github favicon", "title": "github favicon" } renderImage(image) // => <img class="yozora-image" alt="github favicon src="https://github.com/favicon.svg/" title="github favicon"