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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minchin_md_it_superscript-1.0.0.tar.gz.
File metadata
- Download URL: minchin_md_it_superscript-1.0.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0113a582b18d19a7a744306e1646c7b0bdb09c97f41fad95c22242687c5fba13
|
|
| MD5 |
ed9b16523e892a64ad9f1e6ca5b24d97
|
|
| BLAKE2b-256 |
5cfcf3bb924473984f7f3138db043bcf57ed3d70731657af0f05a401174ae636
|
File details
Details for the file minchin_md_it_superscript-1.0.0-py3-none-any.whl.
File metadata
- Download URL: minchin_md_it_superscript-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74b3d264161873421a0b97cb6f1ac7126f3b4cc1054701b332bd7fcd6478cad2
|
|
| MD5 |
7629d5424357ea74bf7fbd3611851b79
|
|
| BLAKE2b-256 |
e99b156c4ba2a41f19955662bbca0bc3229427b87b49c516057b62db5e4ce590
|