Skip to main content

This is a plugin for the Python implementation of Markdown-IT (a CommonMark parser) that provides superscript (<sup>) via carets (^).

Markup is based on the Pandoc superscript extension.

Place superscripted text within caret ^ characters. You must escape any spaces in the superscripted text. Note that you cannot use newline or tab characters, and that nested markup is not supported.

Example usage:

>>> from markdown_it import MarkdownIt
>>> from minchin.md_it.superscript import superscript_plugin
>>> md = MarkdownIt().use(superscript_plugin)
>>> md.render("1^st^")
'<p>1<sup>st</sup></p>\\n'
>>> md.render("this^text\\\\ has\\\\ spaces^")
'<p>this<sup>text has spaces</sup></p>\\n'

Tests can be run using pytest.

For whatever reason, subscript was added to the “official” mdit-py-plugins collection, but superscript has been langishing as an open pull reqest for the past six months. This is meant as an interim measure so I can make use of the plugin locally, until such time as the upstream pull request lands. Maybe you’ll find it helpful too!

Metadata

Release files for minchin.md-it.superscript 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minchin.md-it.superscript 1.0.1
File Size Uploaded
minchin_md_it_superscript-1.0.1.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minchin.md-it.superscript 1.0.1
File Interpreter ABI Platform
minchin_md_it_superscript-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / minchin_md_it_superscript-1.0.1.tar.gz

Download URL minchin_md_it_superscript-1.0.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b4b73c5228f17ee2cde8dbe8a1402d946936993da693970ac10080f8b4528ee8
BLAKE2b-256 checksum
How to use checksums
8751b5f0fb3d3a4f7b9528a992058f0fac4eae9a0926fdad9178e6acbb0b8668
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / minchin_md_it_superscript-1.0.1-py3-none-any.whl

Download URL minchin_md_it_superscript-1.0.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09d17aab9cdf0d83eac94096996e960bf80b0bde0fefbcbc8c91e6354b24211e
BLAKE2b-256 checksum
How to use checksums
15a254f2f6bc3d7c9df8b230a5c4a83e13dcd50c36b4364f22f7c1b25c29420c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page