What is markdown-it-sup?
The markdown-it-sup package is a plugin for the markdown-it Markdown parser that adds support for superscript text. This allows users to easily include superscript text in their Markdown documents.
What are markdown-it-sup's main functionalities?
Superscript Text
This feature allows you to render superscript text in Markdown. In the example, '19^th^ century' will be converted to '19<sup>th</sup> century' in HTML.
const md = require('markdown-it')();
const sup = require('markdown-it-sup');
md.use(sup);
const result = md.render('This is a superscript text example: 19^th^ century.');
console.log(result);
Other packages similar to markdown-it-sup
markdown-it-sub
The markdown-it-sub package is a plugin for the markdown-it Markdown parser that adds support for subscript text. While markdown-it-sup handles superscript text, markdown-it-sub focuses on subscript text, allowing users to include subscript text in their Markdown documents.
markdown-it-attrs
The markdown-it-attrs package is a plugin for the markdown-it Markdown parser that allows users to add attributes to Markdown elements. This is more general-purpose compared to markdown-it-sup, which is specifically for superscript text. With markdown-it-attrs, you can add classes, IDs, and other attributes to various Markdown elements.
markdown-it-footnote
The markdown-it-footnote package is a plugin for the markdown-it Markdown parser that adds support for footnotes. While markdown-it-sup is focused on superscript text, markdown-it-footnote allows users to include footnotes in their Markdown documents, providing a way to add additional information or citations.
markdown-it-sup
Superscript (<sup>
) tag plugin for markdown-it markdown parser.
v1.+ requires markdown-it
v4.+, see changelog.
29^th^
=> 29<sup>th</sup>
Markup is based on pandoc definition. But nested markup is currently not supported.
Install
node.js, browser:
npm install markdown-it-sup --save
bower install markdown-it-sup --save
Use
var md = require('markdown-it')()
.use(require('markdown-it-sup'));
md.render('29^th^')
Differences in browser. If you load script directly into the page, without
package system, module will add itself globally as window.markdownitSup
.
License
MIT