https://github.com/maisonsmd/carta-plugin-subscript
This plugin adds ability to render subscripts and superscripts to Carta
https://github.com/maisonsmd/carta-plugin-subscript
Last synced: 4 months ago
JSON representation
This plugin adds ability to render subscripts and superscripts to Carta
- Host: GitHub
- URL: https://github.com/maisonsmd/carta-plugin-subscript
- Owner: maisonsmd
- License: mit
- Created: 2024-01-22T04:03:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-09T05:57:50.000Z (about 1 year ago)
- Last Synced: 2025-10-21T20:57:39.731Z (8 months ago)
- Language: Svelte
- Size: 95.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# carta-plugin-subscript
This plugin adds ability to render subscripts and superscripts to [Carta](https://github.com/BearToCode/carta).
## New in v2
- Support Carta v4
- This plugin is now just a wrapper of [remark-supersub](https://www.npmjs.com/package/remark-supersub)
## Installation
```shell
npm i carta-plugin-subscript
```
## Setup
### Extension
```svelte
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,
},
});
```
## 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:
