Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sethvincent/remark-bracketed-spans
Add an id, classes, and data attributes to `<span>` tags in markdown.
https://github.com/sethvincent/remark-bracketed-spans
markdown remark
Last synced: 19 days ago
JSON representation
Add an id, classes, and data attributes to `<span>` tags in markdown.
- Host: GitHub
- URL: https://github.com/sethvincent/remark-bracketed-spans
- Owner: sethvincent
- Created: 2017-01-27T19:45:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-04T23:43:01.000Z (almost 5 years ago)
- Last Synced: 2024-10-18T06:59:19.052Z (29 days ago)
- Topics: markdown, remark
- Language: JavaScript
- Size: 9.77 KB
- Stars: 13
- Watchers: 4
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# remark-bracketed-spans
Add an id, classes, and data attributes to `` tags in markdown.
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]
[![conduct][conduct]][conduct-url][npm-image]: https://img.shields.io/npm/v/remark-bracketed-spans.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/remark-bracketed-spans
[travis-image]: https://img.shields.io/travis/sethvincent/remark-bracketed-spans.svg?style=flat-square
[travis-url]: https://travis-ci.org/sethvincent/remark-bracketed-spans
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard
[conduct]: https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat-square
[conduct-url]: CONDUCT.md## About
A [remark](http://npmjs.com/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:
```md
[text in the span]{.class .other-class key=val another=example}
```And results in HTML like this:
```html
text in the span
```## Install
```sh
npm install --save remark-bracketed-spans
```## Usage
This module is a [remark](http://npmjs.com/remark) plugin, and can be used like this:
```js
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](LICENSE.md)