summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-11-20 21:14:52 -0500
committerNed Batchelder <ned@nedbatchelder.com>2010-11-20 21:14:52 -0500
commit661145c137e4159859663e047d4890b132203a42 (patch)
treea193331e3fda6d0aed9390336f6a87ec22e7e8a0
parent973a3055a2c0b46a06eae9141c88a1ae7b2ec3bb (diff)
downloadpython-coveragepy-git-661145c137e4159859663e047d4890b132203a42.tar.gz
Get id attributes into the .px files so they'll be in the HTML so links into documents will work right.
-rw-r--r--doc/_ext/px_xlator.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/_ext/px_xlator.py b/doc/_ext/px_xlator.py
index 00cc854e..f4ddc101 100644
--- a/doc/_ext/px_xlator.py
+++ b/doc/_ext/px_xlator.py
@@ -29,6 +29,10 @@ class PxTranslator(BaseHtmlXlator):
if self.section_level == 1:
raise nodes.SkipNode
else:
+ # The id for the h2 tag is on the parent, move it
+ # down here so we'll get the right HTML.
+ if not node['ids'] and len(node.parent['ids']) > 1:
+ node['ids'] = [node.parent['ids'][1]]
BaseHtmlXlator.visit_title(self, node)
def visit_field_list(self, node):