Skip to content

dbolack-ab/marked-subsuper-text

Repository files navigation

marked-subsuper-text

Adds superscript and subscript notation to marked.js. Derived from Homebrewery.

Superscript

Superscript is created by wrapping the text in a single caret (^). The wrapped text must not have leading or trailing spaces.

This is ^superscript^.

Subscript

Subscript is performed by wrapping the text in double carets (^^). The wrapped text must not have leading or trailing spaces.

This is ^^subscript^^.

Usage

const marked = require("marked");
const markedSubSuper = require("marked-subsuper-text");

marked.use(markedSubSuper());

const html = marked.parse("This is ^^sub^^ and this is ^super^.");
console.log(html);
// <p>This is <sub>sub</sub> and this is <sup>super</sup>.</p>

About

Superscript and subscript extension for marked.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published