markdown-it-kramdown-attrs
v0.1.0
Published
Kramdown Style Attributes for Markdown-it
Downloads
53
Readme
Markdown-it Kramdown Attributes
Add a little bit of Kramdown love to your Markdown-it.
Usage
import KramdownAttrs from "markdown-it-kramdown-attrs"
import MarkdownIt from "markdown-it"
// --
renderer = new MarkdownIt()
renderer.use(
KramdownAttrs
)
Examples
Inline Attributes with Parent attributes
# ![Text](image.jpg){:.class1}
{:.class2}
<h1 class="class2">
<img src="image.jpg" alt="Text" class="class1">
</h1>
Elements with Attributes
Text {.class1}
<p class="class1">
Text
</p>
Mixed {:}
and {:}
after new lines.
Text {.class1}
{.class2}
{.class3}
<p class="class1 class2 class3">
Text
</p>
# ![Text](image.jpg){:.class1}
{:.class2}
{:.class3}
{:.class4}
<h1 class="class2 class3 class4">
<img src="img.jpg" alt="Text" class="class1">
</h1>
Multiple in {:}
# ![Text](image.jpg){:.class1 .class2}
{:.class3 .class4}
<h1 class="class3 class4">
<img src="img.jpg" alt="Text" class="class1 class2">
</h1>