diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py
a
|
b
|
|
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 | |