diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-16 21:51:46 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-16 21:51:46 +0900 |
commit | 30f8640bab786b28e2fbc3a12a4cf212e6f953d1 (patch) | |
tree | f5cf23900a7bc509fe970262195995ddc526fda1 /sphinx/writers/html5.py | |
parent | 5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (diff) | |
parent | 7c340e1c1c43f173f11efc14feb29cd08cedb995 (diff) | |
download | sphinx-git-30f8640bab786b28e2fbc3a12a4cf212e6f953d1.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'sphinx/writers/html5.py')
-rw-r--r-- | sphinx/writers/html5.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py index 5e0be1a41..a08f62f73 100644 --- a/sphinx/writers/html5.py +++ b/sphinx/writers/html5.py @@ -278,7 +278,7 @@ class HTML5Translator(SphinxTranslator, BaseTranslator): if figure_id in self.builder.fignumbers.get(key, {}): self.body.append('<span class="caption-number">') - prefix = self.builder.config.numfig_format.get(figtype) + prefix = self.config.numfig_format.get(figtype) if prefix is None: msg = __('numfig_format is not defined for %s') % figtype logger.warning(msg) @@ -382,14 +382,10 @@ 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.builder.config.highlight_language: - # only pass highlighter options for original language - opts = self.builder.config.highlight_options - else: - opts = {} + opts = self.config.highlight_options.get(lang, {}) - if linenos and self.builder.config.html_codeblock_linenos_style: - linenos = self.builder.config.html_codeblock_linenos_style + if linenos and self.config.html_codeblock_linenos_style: + linenos = self.config.html_codeblock_linenos_style highlighted = self.highlighter.highlight_block( node.rawsource, lang, opts=opts, linenos=linenos, |