https://github.com/markdown-it/markdown-it-sub
Subscript (<sub>) tag plugin for markdown-it markdown parser
https://github.com/markdown-it/markdown-it-sub
Last synced: 3 months ago
JSON representation
Subscript (<sub>) tag plugin for markdown-it markdown parser
- Host: GitHub
- URL: https://github.com/markdown-it/markdown-it-sub
- Owner: markdown-it
- License: mit
- Created: 2015-01-01T00:58:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T13:29:52.000Z (over 1 year ago)
- Last Synced: 2025-04-04T09:42:46.046Z (3 months ago)
- Language: JavaScript
- Homepage: https://markdown-it.github.io/
- Size: 14.6 KB
- Stars: 28
- Watchers: 5
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-sub
[](https://github.com/markdown-it/markdown-it-sub/actions/workflows/ci.yml)
[](https://www.npmjs.org/package/markdown-it-sub)
[](https://coveralls.io/r/markdown-it/markdown-it-sub?branch=master)> Subscript (``) tag plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser.
__v1.+ requires `markdown-it` v4.+, see changelog.__
`H~2~0` => `H2O`
Markup is based on [pandoc](http://johnmacfarlane.net/pandoc/README.html#superscripts-and-subscripts) definition. But nested markup is currently not supported.
## Install
node.js, browser:
```bash
npm install markdown-it-sub --save
bower install markdown-it-sub --save
```## Use
```js
var md = require('markdown-it')()
.use(require('markdown-it-sub'));md.render('H~2~0') // => '
H2O
'
```_Differences in browser._ If you load script directly into the page, without
package system, module will add itself globally as `window.markdownitSub`.## License
[MIT](https://github.com/markdown-it/markdown-it-sub/blob/master/LICENSE)