Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

markdown-it-custom-block

0.1.1 • 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-argument/>
<video controls>
  <source src="video.mp4" type="video/mp4">
</video>

License

MIT

install

npm i markdown-it-custom-block

Downloadsweekly downloads

51

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability