changeset 9793:d2006e6d1d59

rst2man: more robust uppercasing of section titles This handles section titles with child elements such as emphasis or inline literals.
author Martin Geisler <mg@lazybytes.net>
date Sun, 08 Nov 2009 16:16:21 +0100
parents dd1a95ccbe07
children ec8533806e27
files doc/rst2man.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/doc/rst2man.py	Sun Nov 08 11:46:38 2009 +0100
+++ b/doc/rst2man.py	Sun Nov 08 16:16:21 2009 +0100
@@ -1048,7 +1048,8 @@
             raise nodes.SkipNode
         elif self.section_level == 1:
             self.body.append('.SH ')
-            node[:] = nodes.Text(node.astext().upper())
+            for n in node.traverse(nodes.Text):
+                n.parent.replace(n, nodes.Text(n.astext().upper()))
         else:
             self.body.append('.SS ')