@mdit/plugin-sub
Plugin to support subscript.
Usage
TS
import MarkdownIt from "markdown-it";
import { sub } from "@mdit/plugin-sub";
const mdIt = MarkdownIt().use(sub);
mdIt.render("H~2~O");
JS
const MarkdownIt = require("markdown-it");
const { sub } = require("@mdit/plugin-sub");
const mdIt = MarkdownIt().use(sub);
mdIt.render("H~2~O");
Syntax
Use ~ ~
to mark the subscript.
Escaping
You can use
\
to escape~
:H\~2~O
will be
H~2~O
Demo
H~2~O
: H2O