Skip to content

Commit

Permalink
Accept more values for has_math
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 1, 2018
1 parent 00a6751 commit 1e184d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nikola/post.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1e184d8

Please sign in to comment.