Skip to content
Permalink
Browse files
Accept more values for has_math
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 1, 2018
1 parent 00a6751 commit 1e184d844215a60e4f1f84419525b44ca5ed3cfa
Showing with 3 additions and 3 deletions.
  1. +3 −3 nikola/post.py
@@ -267,7 +267,7 @@ def __init__(
is_draft = True
else:
LOGGER.warn(('The post "{0}" has the unknown status "{1}". ' +
'Valid values are "published", "private" and "draft".').format(self.source_path, status))
'Valid values are "published", "featured", "private" and "draft".').format(self.source_path, status))

if self.config['WARN_ABOUT_TAG_METADATA']:
show_warning = False
@@ -359,13 +359,13 @@ def has_math(self):
return True
lang = nikola.utils.LocaleBorg().current_lang
if self.is_translation_available(lang):
if self.meta[lang].get('has_math') in ('true', 'True', 'yes'):
if self.meta[lang].get('has_math') in ('true', 'True', 'yes', '1', 1, True):
return True
if self.config['USE_TAG_METADATA']:
return 'mathjax' in self.tags_for_language(lang)
# If it has math in ANY other language, enable it. Better inefficient than broken.
for lang in self.translated_to:
if self.meta[lang].get('has_math') in ('true', 'True', 'yes'):
if self.meta[lang].get('has_math') in ('true', 'True', 'yes', '1', 1, True):
return True
if self.config['USE_TAG_METADATA']:
return 'mathjax' in self.alltags

0 comments on commit 1e184d8

Please sign in to comment.