Skip to main content

Text Decorator Extension for Python-Markdown.

Project description

Markdown Text Decorator Extension

This extension add Text Decorate handler to Python-Markdown.

Spec

This extension supports follwing expressions.

Type Markdown HTML
delete --text-- <del>text</del>
insert ++text++ <ins>text</ins>
strikethrough ~~text~~ <s>text</s>

Installation

python3 -m pip install markdown_text_decorator

Usage

Code

from markdown import Markdown

MARKDOWN_EXTENSIONS = [
    "markdown_text_decorator"
]

md2html = Markdown(extensions=MARKDOWN_EXTENSIONS)

markdown_input = """

# Markdown Text Decoration

~~This is~~ strikethrough ~~line.~~

++This is++ insert ++line.++ 

--This is-- delete --line.--

"""

html_output = md2html.convert(markdown_input)

print(html_output)

Result

<h1>Markdown Text Decoration</h1>
<p><s>This is strikethrough line.</s></p>
<p><ins>This is insert line.</ins> </p>
<p><del>This is delete line.</del></p>

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

markdown_text_decorator-1.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

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