Skip to content

Commit

Permalink
Merge pull request #5082 from tk0miya/mathjax_broken
Browse files Browse the repository at this point in the history
Fix mathjax is not loaded
  • Loading branch information
tk0miya committed Jun 13, 2018
2 parents 1c3eadc + e5ddc36 commit 2855721
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sphinx/ext/jsmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def builder_inited(app):
if not app.config.jsmath_path:
raise ExtensionError('jsmath_path config value must be set for the '
'jsmath extension to work')
app.add_js_file(app.config.jsmath_path)
if app.builder.format == 'html':
app.builder.add_js_file(app.config.jsmath_path) # type: ignore


def setup(app):
Expand Down
5 changes: 3 additions & 2 deletions sphinx/ext/mathjax.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def builder_inited(app):
if not app.config.mathjax_path:
raise ExtensionError('mathjax_path config value must be set for the '
'mathjax extension to work')
options = {'async': 'async'}
app.add_js_file(app.config.mathjax_path, **options)
if app.builder.format == 'html':
options = {'async': 'async'}
app.builder.add_js_file(app.config.mathjax_path, **options) # type: ignore


def setup(app):
Expand Down

0 comments on commit 2855721

Please sign in to comment.