summaryrefslogtreecommitdiff
path: root/sphinx/ext/viewcode.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-06-24 11:35:15 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-06-24 11:35:15 +0900
commit04723c1175b856d309a2e6ce18835ae675311ba3 (patch)
tree46d2eaf6586d08f58b0ca258fca877bfd6686773 /sphinx/ext/viewcode.py
parent1e979091f25f5d20bb9b64d554183fcb0f2f37e4 (diff)
downloadsphinx-git-04723c1175b856d309a2e6ce18835ae675311ba3.tar.gz
Fix #2479: `sphinx.ext.viewcode` uses python2 highlighter by default
Diffstat (limited to 'sphinx/ext/viewcode.py')
-rw-r--r--sphinx/ext/viewcode.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py
index 89e7a9965..a071c5533 100644
--- a/sphinx/ext/viewcode.py
+++ b/sphinx/ext/viewcode.py
@@ -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)