diff options
| author | Georg Brandl <georg@python.org> | 2012-01-29 10:21:01 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2012-01-29 10:21:01 +0100 |
| commit | 7d264e1e22e7eb605bbbeaa2c14870439b77a824 (patch) | |
| tree | 7f379ef99901d2819d1daed42971a08b0c6513be /sphinx/writers/html.py | |
| parent | 15466fb057aa8f479503e53f8fc5b3a3ebea7fbf (diff) | |
| download | sphinx-7d264e1e22e7eb605bbbeaa2c14870439b77a824.tar.gz | |
Closes #695: When the highlight language "python" is specified explicitly, do not try to parse the code to recognize non-Python snippets.
Thanks to Jonas Haag for the patch.
Diffstat (limited to 'sphinx/writers/html.py')
| -rw-r--r-- | sphinx/writers/html.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 787b3105..1830519c 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -233,12 +233,13 @@ class HTMLTranslator(BaseTranslator): lang = self.highlightlang linenos = node.rawsource.count('\n') >= \ self.highlightlinenothreshold - 1 + highlight_args = node.get('highlight_args', {}) if node.has_key('language'): # code-block directives lang = node['language'] + highlight_args['force'] = True if node.has_key('linenos'): linenos = node['linenos'] - highlight_args = node.get('highlight_args', {}) def warner(msg): self.builder.warn(msg, (self.builder.current_docname, node.line)) highlighted = self.highlighter.highlight_block( |
