mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Fix #2479: sphinx.ext.viewcode uses python2 highlighter by default
This commit is contained in:
@@ -28,6 +28,7 @@ Bugs fixed
|
|||||||
* #2679: ``float`` package needed for ``'figure_align': 'H'`` latex option
|
* #2679: ``float`` package needed for ``'figure_align': 'H'`` latex option
|
||||||
* #2671: image directive may lead to inconsistent spacing in pdf
|
* #2671: image directive may lead to inconsistent spacing in pdf
|
||||||
* #2705: `toctree` generates empty bullet_list if ``:titlesonly:`` specified
|
* #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)
|
Release 1.4.4 (released Jun 12, 2016)
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ def collect_pages(app):
|
|||||||
# construct a page name for the highlighted source
|
# construct a page name for the highlighted source
|
||||||
pagename = '_modules/' + modname.replace('.', '/')
|
pagename = '_modules/' + modname.replace('.', '/')
|
||||||
# highlight the source using the builder's highlighter
|
# highlight the source using the builder's highlighter
|
||||||
if env.config.highlight_language == 'python3':
|
if env.config.highlight_language in ('python3', 'default'):
|
||||||
lexer = 'python3'
|
lexer = env.config.highlight_language
|
||||||
else:
|
else:
|
||||||
lexer = 'python'
|
lexer = 'python'
|
||||||
highlighted = highlighter.highlight_block(code, lexer, linenos=False)
|
highlighted = highlighter.highlight_block(code, lexer, linenos=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user