@yozora/html-strong
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.2 • Public • Published

@yozora/html-strong


This component is for rendering the Yozora Markdown AST node IStrong produced by @yozora/tokenizer-strong into HTML string.

This component has been built into [@yozora/html-markdown][], you can use it directly.

Install

  • npm

    npm install --save @yozora/html-strong
  • yarn

    yarn add @yozora/html-strong

Usage

  • Basic:

    import type { IStrong, IYastNode } from '@yozora/ast'
    import renderStrong from '@yozora/html-strong'
    
    // The implementation of the following function has been omitted.
    const renderChildren: (nodes: IYastNode[]) => string = function () {}
    
    const strong = {
      "type": "strong",
      "children": [
        {
          "type": "text",
          "value": "yozora is cool!"
        }
      ]
    }
    renderStrong(strong as IStrong, renderChildren)
    // => <strong class="yozora-strong"><span class="yozora-text">yozora is cool!</span></strong>

Related

Package Sidebar

Install

npm i @yozora/html-strong

Weekly Downloads

0

Version

2.0.0-alpha.2

License

MIT

Unpacked Size

6.25 kB

Total Files

6

Last publish

Collaborators

  • lemonclown