0.1.2 • Published 3 years ago

markdown-it-custom-block v0.1.2

Weekly downloads
983
License
MIT
Repository
github
Last release
3 years ago

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