1.0.0 • Published 6 months ago

markdown-it-custom-block v1.0.0

Weekly downloads
983
License
MIT
Repository
github
Last release
6 months ago

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