Skip to content

Commit

Permalink
The ^ symbol can now be used as an alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilhelmer authored and Wilhelmer committed Sep 10, 2019
1 parent 44c0cde commit e1b14c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The syntax is:
```
!!<class name>|<text to be wrapped>!!
```

For instance:

```shell
Expand All @@ -25,6 +26,8 @@ will return
<p>I love <span class="text-alert">spam</span></p>
```

**Tip**: If the | symbol causes conflicts with your Markdown tables, use ^ instead of |.

### Installation

```shell
Expand Down
3 changes: 2 additions & 1 deletion custom-span-class.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
>>> md.convert('i love !! |spam!!')
u'<p>i love !! |spam!!</p>'
If the | symbol causes conflicts with your Markdown tables, use ^ instead of |.
copyright @2014 Konrad Wasowicz <exaroth@gmail.com>
"""
Expand All @@ -33,7 +34,7 @@
from markdown.inlinepatterns import Pattern


CUSTOM_CLS_RE = r'[!]{2}(?P<class>[^!]+)[|](?P<text>[^!]+)[!]{2}'
CUSTOM_CLS_RE = r'[!]{2}(?P<class>[^!]+)[|\^](?P<text>[^!]+)[!]{2}'


class CustomSpanClassExtension(Extension):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup
setup(
name='mdx-custom-span-class',
version='1.1.2',
version='1.1.3',
author='Konrad Wasowicz',
author_email='exaroth@gmail.com',
description='Markdown extension which allows inserting span elements with custom class',
Expand Down

0 comments on commit e1b14c4

Please sign in to comment.