Merge pull request #8672 from tk0miya/8671_highlight_options_not_working

Fix #8671: highlight_options is not working
This commit is contained in:
Takeshi KOMIYA 2021-01-11 20:48:54 +09:00 committed by GitHub
commit 98993b40c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View File

@ -46,6 +46,7 @@ Bugs fixed
* #8665: html theme: Could not override globaltoc_maxdepth in theme.conf
* #8094: texinfo: image files on the different directory with document are not
copied
* #8671: :confval:`highlight_options` is not working
Testing
--------

View File

@ -439,7 +439,7 @@ class HTMLTranslator(SphinxTranslator, BaseTranslator):
linenos = node.get('linenos', False)
highlight_args = node.get('highlight_args', {})
highlight_args['force'] = node.get('force', False)
if lang is self.config.highlight_language:
if lang == self.config.highlight_language:
# only pass highlighter options for original language
opts = self.config.highlight_options
else:

View File

@ -390,7 +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 is self.config.highlight_language:
if lang == self.config.highlight_language:
# only pass highlighter options for original language
opts = self.config.highlight_options
else:

View File

@ -1751,7 +1751,7 @@ class LaTeXTranslator(SphinxTranslator):
linenos = node.get('linenos', False)
highlight_args = node.get('highlight_args', {})
highlight_args['force'] = node.get('force', False)
if lang is self.config.highlight_language:
if lang == self.config.highlight_language:
# only pass highlighter options for original language
opts = self.config.highlight_options
else: