mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make parsed-literal blocks work as expected.
This commit is contained in:
parent
08d86db91c
commit
5f488517ce
3
CHANGES
3
CHANGES
@ -16,6 +16,9 @@ Changes in trunk
|
||||
|
||||
* sphinx.builder: The WebHTMLBuilder is now called PickleHTMLBuilder.
|
||||
|
||||
* sphinx.htmlwriter: Make parsed-literal blocks work as expected,
|
||||
not highlighting them via Pygments.
|
||||
|
||||
|
||||
Release 0.1.61798 (Mar 23, 2008)
|
||||
================================
|
||||
|
@ -180,6 +180,9 @@ class HTMLTranslator(BaseTranslator):
|
||||
|
||||
# overwritten
|
||||
def visit_literal_block(self, node):
|
||||
if node.rawsource != node.astext():
|
||||
# most probably a parsed-literal block -- don't highlight
|
||||
return BaseTranslator.visit_literal_block(self, node)
|
||||
lang = self.highlightlang
|
||||
linenos = node.rawsource.count('\n') >= self.highlightlinenothreshold - 1
|
||||
if node.has_key('language'):
|
||||
|
Loading…
Reference in New Issue
Block a user