0.1.0 • Published 8 years ago

markdown-it-kramdown-attrs v0.1.0

Weekly downloads
15
License
LicenseRef-licens...
Repository
github
Last release
8 years ago

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>