markdown-it-custom-block
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

markdown-it-custom-block

Handle custom blocks transformations

Usage

const customBlock = require('markdown-it-custom-block')
 
markdownit()
  .use(customBlock, {
    example (arg) {
      return `<example-${arg}/>`
    },
    video (url) {
      return `<video controls>
        <source src="${url}" type="video/mp4">
      </video>`
    }
  })
@[example](hello)
 
@[video](video.mp4)

becomes

<example-hello/>
<video controls>
  <source src="video.mp4" type="video/mp4">
</video>

License

MIT

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i markdown-it-custom-block

    Weekly Downloads

    152

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    11.6 kB

    Total Files

    21

    Last publish

    Collaborators

    • posva