Miss any of our Open RFC calls?Watch the recordings here! »

markdown-it-kramdown-attrs

0.1.0 • Public • Published

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>

Keywords

none

Install

npm i markdown-it-kramdown-attrs

DownloadsWeekly Downloads

6

Version

0.1.0

License

LicenseRef-license.txt

Last publish

Collaborators

  • avatar
  • avatar