Last active
February 24, 2020 20:34
-
-
Save dinocarl/1735530ec07e5471f87ffb86d204e104 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const md = require('markdown-it')(); | |
const markdownItAttrs = require('markdown-it-attrs'); | |
const src = ` | |
# header {: .title-class #title-id } | |
some text {: with=attrs and="attrs with space" } | |
more body copy with some *emphasis*{: .emph-class } thrown in {: .para-class} | |
- item 1 | |
- item 2 {: .item-class } | |
- item 3 | |
{: .list-class } | |
`; | |
// render markdown | |
md | |
.use( | |
markdownItAttrs, | |
// support kramdown | |
{ leftDelimiter: '{:' } | |
) | |
.render(src); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment