Mercurial > public > mercurial-scm > hg-stable
diff doc/rst2man.py @ 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 | 8bba9157b30a |
children | 9c142ed9c405 |
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 ')