Skip to content

This plugin adds ability to render subscripts and superscripts to Carta

License

Notifications You must be signed in to change notification settings

maisonsmd/carta-plugin-subscript

Repository files navigation

carta-plugin-subscript

carta-plugin-subscript

This plugin adds ability to render subscripts and superscripts to Carta.

New in v2

Installation

npm i carta-plugin-subscript

Setup

Extension

<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} />

Usage

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:

output

About

This plugin adds ability to render subscripts and superscripts to Carta

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published