Fix markdown_striketrugh import not working
This commit is contained in:
parent
472045cbfd
commit
b06a9b578e
1 changed files with 9 additions and 3 deletions
12
app.py
12
app.py
|
|
@ -28,8 +28,12 @@ try:
|
||||||
from slugify import slugify
|
from slugify import slugify
|
||||||
except ImportError:
|
except ImportError:
|
||||||
slugify = None
|
slugify = None
|
||||||
|
try:
|
||||||
__version__ = '0.3-dev'
|
import markdown_strikethrough
|
||||||
|
except Exception:
|
||||||
|
markdown_strikethrough = None
|
||||||
|
|
||||||
|
__version__ = '0.3.0'
|
||||||
|
|
||||||
#### CONSTANTS ####
|
#### CONSTANTS ####
|
||||||
|
|
||||||
|
|
@ -384,7 +388,9 @@ def expand_magic_words(text):
|
||||||
def md(text, expand_magic=True, toc=True):
|
def md(text, expand_magic=True, toc=True):
|
||||||
if expand_magic:
|
if expand_magic:
|
||||||
text = expand_magic_words(text)
|
text = expand_magic_words(text)
|
||||||
extensions = ['tables', 'footnotes', 'markdown_strikethrough.extension', 'fenced_code', 'sane_lists']
|
extensions = ['tables', 'footnotes', 'fenced_code', 'sane_lists']
|
||||||
|
if markdown_strikethrough:
|
||||||
|
extensions.append("markdown_strikethrough.extension")
|
||||||
if toc:
|
if toc:
|
||||||
extensions.append('toc')
|
extensions.append('toc')
|
||||||
return markdown.Markdown(extensions=extensions).convert(text)
|
return markdown.Markdown(extensions=extensions).convert(text)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue