diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-11-08 20:41:00 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-11-08 20:41:00 (GMT) |
commit | bf764a1912b084e5fc9acd6cb160e66060bc368a (patch) | |
tree | 692f3ecbc83e02536bb3956e992c537ba18debf8 /Doc/tools | |
parent | 479c1176bf8e8d7af65f73a1a12e7e334b6785c4 (diff) | |
parent | eb1a3cd4eaaaecad9ae1673376dd27ba44abee33 (diff) | |
download | cpython-bf764a1912b084e5fc9acd6cb160e66060bc368a.zip cpython-bf764a1912b084e5fc9acd6cb160e66060bc368a.tar.gz cpython-bf764a1912b084e5fc9acd6cb160e66060bc368a.tar.bz2 |
Issue #22695: Fix rendering of the deprecated-removed role in HTML.
Diffstat (limited to 'Doc/tools')
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 9d1c195..41c25bc 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -172,22 +172,20 @@ class DeprecatedRemoved(Directive): messages = [] if self.content: self.state.nested_parse(self.content, self.content_offset, node) + if len(node): if isinstance(node[0], nodes.paragraph) and node[0].rawsource: content = nodes.inline(node[0].rawsource, translatable=True) content.source = node[0].source content.line = node[0].line content += node[0].children node[0].replace_self(nodes.paragraph('', '', content)) - node[0].insert(0, nodes.inline('', '%s: ' % text, - classes=['versionmodified'])) + node[0].insert(0, nodes.inline('', '%s: ' % text, + classes=['versionmodified'])) else: para = nodes.paragraph('', '', nodes.inline('', '%s.' % text, classes=['versionmodified'])) - if len(node): - node.insert(0, para) - else: - node.append(para) + node.append(para) env = self.state.document.settings.env env.note_versionchange('deprecated', version[0], node, self.lineno) return [node] + messages |