Skip to main content

Superscript, for Markdown-IT-py

Project description

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 mdit_py_plugins.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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minchin_md_it_superscript-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minchin_md_it_superscript-1.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file minchin_md_it_superscript-1.0.0.tar.gz.

File metadata

File hashes

Hashes for minchin_md_it_superscript-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0113a582b18d19a7a744306e1646c7b0bdb09c97f41fad95c22242687c5fba13
MD5 ed9b16523e892a64ad9f1e6ca5b24d97
BLAKE2b-256 5cfcf3bb924473984f7f3138db043bcf57ed3d70731657af0f05a401174ae636

See more details on using hashes here.

File details

Details for the file minchin_md_it_superscript-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minchin_md_it_superscript-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74b3d264161873421a0b97cb6f1ac7126f3b4cc1054701b332bd7fcd6478cad2
MD5 7629d5424357ea74bf7fbd3611851b79
BLAKE2b-256 e99b156c4ba2a41f19955662bbca0bc3229427b87b49c516057b62db5e4ce590

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page