rst2man: more robust uppercasing of section titles
authorMartin Geisler <mg@lazybytes.net>
Sun, 08 Nov 2009 16:16:21 +0100
changeset 9793 d2006e6d1d59
parent 9792 dd1a95ccbe07
child 9794 ec8533806e27
rst2man: more robust uppercasing of section titles This handles section titles with child elements such as emphasis or inline literals.
doc/rst2man.py
--- 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 ')