This plugin adds ability to render subscripts and superscripts to Carta.
- Support Carta v4
- This plugin is now just a wrapper of remark-supersub
npm i carta-plugin-subscript
<script>
import { Carta, MarkdownEditor } from 'carta-md';
import { subscript } from 'carta-plugin-subscript';
const carta = new Carta({
extensions: [subscript()],
gfmOptions: {
// remark-gfm that Carta uses convert single tilde to strikethrough, disable that to use single tilde for subscript.
// see https://stackoverflow.com/a/78076200/7884074
singleTilde: false,
},
});
</script>
<MarkdownEditor {carta} />
This snippet:
H~2~O, CO~2~ and CH~4~ are greenhouse gases.
In the 19^th^ century, the concentration of CO~2~ was 280 ppm.
will generate this output: