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

1.0.0 • Public • Published

markdown-it-custom-block

Handle custom blocks transformations

Usage

import customBlock from '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

Package Sidebar

Install

npm i markdown-it-custom-block

Weekly Downloads

317

Version

1.0.0

License

MIT

Unpacked Size

11.8 kB

Total Files

21

Last publish

Collaborators

  • posva