Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e8707e068d5e4374204b813ca26bd4150eef7023 1 parent d1102d6
Malcolm Tredinnick authored

Showing 1 changed file with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. 12  docs/_ext/djangodocs.py
12  docs/_ext/djangodocs.py
@@ -130,21 +130,21 @@ def depart_versionmodified(self, node):
130 130
     
131 131
     # Give each section a unique ID -- nice for custom CSS hooks
132 132
     # This is different on docutils 0.5 vs. 0.4...
133  
-    
134  
-    # The docutils 0.4 override.
135  
-    if hasattr(sphinx.htmlwriter.SmartyPantsHTMLTranslator, 'start_tag_with_title'):
  133
+
  134
+    if hasattr(sphinx.htmlwriter.SmartyPantsHTMLTranslator, 'start_tag_with_title') and sphinx.__version__ == '0.4.2':
136 135
         def start_tag_with_title(self, node, tagname, **atts):
137 136
             node = {
138 137
                 'classes': node.get('classes', []), 
139 138
                 'ids': ['s-%s' % i for i in node.get('ids', [])]
140 139
             }
141 140
             return self.starttag(node, tagname, **atts)
142  
-            
143  
-    # The docutils 0.5 override.
144  
-    else:        
  141
+
  142
+    else:
145 143
         def visit_section(self, node):
146 144
             old_ids = node.get('ids', [])
147 145
             node['ids'] = ['s-' + i for i in old_ids]
  146
+            if sphinx.__version__ != '0.4.2':
  147
+                node['ids'].extend(old_ids)
148 148
             sphinx.htmlwriter.SmartyPantsHTMLTranslator.visit_section(self, node)
149 149
             node['ids'] = old_ids
150 150
 

0 notes on commit e8707e0

Please sign in to comment.
Something went wrong with that request. Please try again.