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

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.1.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.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for minchin_md_it_superscript-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b4b73c5228f17ee2cde8dbe8a1402d946936993da693970ac10080f8b4528ee8
MD5 ac7e7f420b3255e97f055f44140c5569
BLAKE2b-256 8751b5f0fb3d3a4f7b9528a992058f0fac4eae9a0926fdad9178e6acbb0b8668

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minchin_md_it_superscript-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09d17aab9cdf0d83eac94096996e960bf80b0bde0fefbcbc8c91e6354b24211e
MD5 63d76ea17182f925e0c21759ee43a8a4
BLAKE2b-256 15a254f2f6bc3d7c9df8b230a5c4a83e13dcd50c36b4364f22f7c1b25c29420c

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