[Python-checkins] r61814 - in doctools/trunk: CHANGES sphinx/htmlwriter.py

georg.brandl python-checkins at python.org
Sun Mar 23 22:11:33 CET 2008


Author: georg.brandl
Date: Sun Mar 23 22:11:33 2008
New Revision: 61814

Modified:
   doctools/trunk/CHANGES
   doctools/trunk/sphinx/htmlwriter.py
Log:
Make parsed-literal blocks work as expected.


Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Sun Mar 23 22:11:33 2008
@@ -16,6 +16,9 @@
 
 * 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)
 ================================

Modified: doctools/trunk/sphinx/htmlwriter.py
==============================================================================
--- doctools/trunk/sphinx/htmlwriter.py	(original)
+++ doctools/trunk/sphinx/htmlwriter.py	Sun Mar 23 22:11:33 2008
@@ -180,6 +180,9 @@
 
     # 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'):


More information about the Python-checkins mailing list