Fix #2479: sphinx.ext.viewcode uses python2 highlighter by default

This commit is contained in:
Takeshi KOMIYA 2016-06-24 11:35:15 +09:00
parent 1e979091f2
commit 04723c1175
2 changed files with 3 additions and 2 deletions

View File

@ -28,6 +28,7 @@ Bugs fixed
* #2679: ``float`` package needed for ``'figure_align': 'H'`` latex option
* #2671: image directive may lead to inconsistent spacing in pdf
* #2705: `toctree` generates empty bullet_list if ``:titlesonly:`` specified
* #2479: `sphinx.ext.viewcode` uses python2 highlighter by default
Release 1.4.4 (released Jun 12, 2016)

View File

@ -139,8 +139,8 @@ def collect_pages(app):
# construct a page name for the highlighted source
pagename = '_modules/' + modname.replace('.', '/')
# highlight the source using the builder's highlighter
if env.config.highlight_language == 'python3':
lexer = 'python3'
if env.config.highlight_language in ('python3', 'default'):
lexer = env.config.highlight_language
else:
lexer = 'python'
highlighted = highlighter.highlight_block(code, lexer, linenos=False)