mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #8671: highlight_options is not working
Sadly HTML and LaTeX writers compares the highlight languages using `is` operator. As a result, it has not worked even if languages are same. This replaces the comparison operator by `==`.
This commit is contained in:
parent
6e445e1175
commit
d7cdb9e22d
1
CHANGES
1
CHANGES
@ -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
|
||||
--------
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user