summaryrefslogtreecommitdiff
path: root/sphinx/writers/html5.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/writers/html5.py')
-rw-r--r--sphinx/writers/html5.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py
index a169c6069..a68951a7f 100644
--- a/sphinx/writers/html5.py
+++ b/sphinx/writers/html5.py
@@ -404,11 +404,14 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
return super().visit_literal_block(node)
lang = node.get('language', 'default')
- linenos = node.get('linenos', False) and "inline"
+ linenos = node.get('linenos', False)
highlight_args = node.get('highlight_args', {})
highlight_args['force'] = node.get('force', False)
opts = self.config.highlight_options.get(lang, {})
+ 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,
location=node, **highlight_args