summaryrefslogtreecommitdiff
path: root/sphinx/writers/html5.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-11 00:02:38 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-11 21:40:09 +0900
commit32ac5f2e57ae25d8b75e93a3fca4ad74327e72c7 (patch)
tree8a6f13ae52e82c040eade975d36812b638c3cdef /sphinx/writers/html5.py
parent98993b40c5451a6db84b4c1e8549c03a9ee24677 (diff)
downloadsphinx-git-32ac5f2e57ae25d8b75e93a3fca4ad74327e72c7.tar.gz
Close #207: Now highlight_language supports multiple languages
This changes the structure of `highlight_options` to a dictionary that maps language names to option dictionary. It allows to setting pygments options for multiple languages at once.
Diffstat (limited to 'sphinx/writers/html5.py')
-rw-r--r--sphinx/writers/html5.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py
index 557027da5..d7c7b95e8 100644
--- a/sphinx/writers/html5.py
+++ b/sphinx/writers/html5.py
@@ -390,11 +390,7 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
linenos = node.get('linenos', False)
highlight_args = node.get('highlight_args', {})
highlight_args['force'] = node.get('force', False)
- if lang == self.config.highlight_language:
- # only pass highlighter options for original language
- opts = self.config.highlight_options
- else:
- opts = {}
+ opts = self.config.highlight_options.get(lang, {})
if linenos and self.config.html_codeblock_linenos_style:
linenos = self.config.html_codeblock_linenos_style