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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    126
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    126
  • 0.1.1
    7
  • 0.1.0
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i markdown-it-custom-block

Weekly Downloads

133

Version

0.1.2

License

MIT

Unpacked Size

11.6 kB

Total Files

21

Last publish

Collaborators

  • posva