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