Author: mtredinnick
Date: 2008-12-06 22:00:08 -0600 (Sat, 06 Dec 2008)
New Revision: 9586

Modified:
   django/trunk/docs/_ext/djangodocs.py
Log:
Fixed #9645 -- Work around a backwards-incompatibility in Sphinx so that
various combinations of released docutils and sphinx versions all work
together. Thanks, Ramiro Morales.


Modified: django/trunk/docs/_ext/djangodocs.py
===================================================================
--- django/trunk/docs/_ext/djangodocs.py        2008-12-07 03:56:50 UTC (rev 
9585)
+++ django/trunk/docs/_ext/djangodocs.py        2008-12-07 04:00:08 UTC (rev 
9586)
@@ -130,21 +130,21 @@
     
     # Give each section a unique ID -- nice for custom CSS hooks
     # This is different on docutils 0.5 vs. 0.4...
-    
-    # The docutils 0.4 override.
-    if hasattr(sphinx.htmlwriter.SmartyPantsHTMLTranslator, 
'start_tag_with_title'):
+
+    if hasattr(sphinx.htmlwriter.SmartyPantsHTMLTranslator, 
'start_tag_with_title') and sphinx.__version__ == '0.4.2':
         def start_tag_with_title(self, node, tagname, **atts):
             node = {
                 'classes': node.get('classes', []), 
                 'ids': ['s-%s' % i for i in node.get('ids', [])]
             }
             return self.starttag(node, tagname, **atts)
-            
-    # The docutils 0.5 override.
-    else:        
+
+    else:
         def visit_section(self, node):
             old_ids = node.get('ids', [])
             node['ids'] = ['s-' + i for i in old_ids]
+            if sphinx.__version__ != '0.4.2':
+                node['ids'].extend(old_ids)
             sphinx.htmlwriter.SmartyPantsHTMLTranslator.visit_section(self, 
node)
             node['ids'] = old_ids
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to