0.1.1 • Published 5 years ago

peter-markdown-it-custom-block v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 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

0.1.1

5 years ago