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

2.0.0-alpha.2 • Public • Published

@yozora/html-blockquote


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>

Related

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @yozora/html-blockquote

      Weekly Downloads

      0

      Version

      2.0.0-alpha.2

      License

      MIT

      Unpacked Size

      6.5 kB

      Total Files

      6

      Last publish

      Collaborators

      • lemonclown