Make parsed-literal blocks work as expected.

This commit is contained in:
Georg Brandl 2008-03-23 21:11:33 +00:00
parent 08d86db91c
commit 5f488517ce
2 changed files with 6 additions and 0 deletions

View File

@ -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)
================================

View File

@ -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'):