remark-bracketed-spans

3.0.0 • Public • Published

remark-bracketed-spans

Add an id, classes, and data attributes to <span> tags in markdown.

npm travis standard conduct

About

A remark plugin for adding attributes to span tags in markdown that works even when the span is nested inside other markdown elements.

Usage looks like this:

[text in the span]{.class .other-class key=val another=example}

And results in HTML like this:

<p><span class="class other-class" data-key="val" data-another="example">text in the span</span></p>

Install

npm install --save remark-bracketed-spans

Usage

This module is a remark plugin, and can be used like this:

var remark = require('remark')
var toHTML = require('remark-html')
var bracketedSpans = require('remark-bracketed-spans')
 
var md = '[text in the span]{.class .other-class key=val another=example}'
 
var html = remark().use(bracketedSpans).use(toHTML).processSync(md).toString()
 
console.log(html)

License

ISC

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    33
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    33
  • 2.1.0
    0
  • 2.0.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i remark-bracketed-spans

Weekly Downloads

29

Version

3.0.0

License

ISC

Last publish

Collaborators

  • sethvincent
  • wooorm