Skip to content
Permalink
Browse files

Handle unset MARKDOWN_EXTENSION_CONFIGS correctly

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 13, 2018
1 parent ad886d6 commit 98948cca05253cf5e7c0c9638842df0c0e0ee862
Showing with 3 additions and 2 deletions.
  1. +3 −2 nikola/plugins/compile/markdown/__init__.py
@@ -91,14 +91,15 @@ def set_site(self, site):
self.config_dependencies.append(str(sorted(site_extensions)))
extensions.extend(site_extensions)

site_extension_configs = self.site.config.get("MARKDOWN_EXTENSION_CONFIGS", {})
site_extension_configs = self.site.config.get("MARKDOWN_EXTENSION_CONFIGS")
if site_extension_configs:
self.config_dependencies.append(json.dumps(site_extension_configs.values, sort_keys=True))

if Markdown is not None:
self.converters = {}
for lang in self.site.config['TRANSLATIONS']:
self.converters[lang] = ThreadLocalMarkdown(extensions, site_extension_configs(lang))
lang_extension_configs = site_extension_configs(lang) if site_extension_configs else {}
self.converters[lang] = ThreadLocalMarkdown(extensions, lang_extension_configs)
self.supports_metadata = 'markdown.extensions.meta' in extensions

def compile_string(self, data, source_path=None, is_two_file=True, post=None, lang=None):

0 comments on commit 98948cc

Please sign in to comment.
You can’t perform that action at this time.