Adjust Markdown Version Checks to Avoid Warning

This commit is contained in:
Tim Gates 2019-04-08 11:00:04 +10:00
parent 29cbe574a3
commit 68c3b4508a
No known key found for this signature in database
GPG Key ID: AE3BE0D53823CF05

View File

@ -184,10 +184,12 @@ if 'patch' not in View.http_method_names:
try: try:
import markdown import markdown
if markdown.version <= '2.2': if not hasattr(markdown, '__version__') and markdown.version <= '2.2':
HEADERID_EXT_PATH = 'headerid' HEADERID_EXT_PATH = 'headerid'
LEVEL_PARAM = 'level' LEVEL_PARAM = 'level'
elif markdown.version < '2.6': elif not hasattr(markdown, '__version__') or (
type(markdown.__version__) != type('') and markdown.version < '2.6'
):
HEADERID_EXT_PATH = 'markdown.extensions.headerid' HEADERID_EXT_PATH = 'markdown.extensions.headerid'
LEVEL_PARAM = 'level' LEVEL_PARAM = 'level'
else: else: