Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 587 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 587 Bytes

Custom Span Class Markdown Extension

This is a simple extension for Python-Markdown library, which allows adding span elements with custom class. The syntax is:

!!<class name>|<text to be wrapped>!!

For instance:

I love !!text-alert|spam!!

will return

<p>I love <span class="text-alert">spam</span></p>

Installation

pip install git+git://github.com/exaroth/mdx_custom_span_class.git

Usage

import markdown

md = markdown.Markdown(extensions=["custom_span_class"])
md.convert("I love !!text-danger|spam!!")