mirror of
https://github.com/python/cpython.git
synced 2025-08-18 15:51:23 +00:00
Make it more robust.
This commit is contained in:
parent
08be2e2f35
commit
a054722778
1 changed files with 7 additions and 1 deletions
|
@ -58,8 +58,14 @@ class ImplementationDetail(Directive):
|
||||||
def run(self):
|
def run(self):
|
||||||
pnode = nodes.compound(classes=['impl-detail'])
|
pnode = nodes.compound(classes=['impl-detail'])
|
||||||
content = self.content
|
content = self.content
|
||||||
content[0] = '**CPython implementation detail:** ' + content[0]
|
add_text = nodes.strong('CPython implementation detail:',
|
||||||
|
'CPython implementation detail:')
|
||||||
self.state.nested_parse(content, self.content_offset, pnode)
|
self.state.nested_parse(content, self.content_offset, pnode)
|
||||||
|
if pnode.children and isinstance(pnode[0], nodes.paragraph):
|
||||||
|
pnode[0].insert(0, add_text)
|
||||||
|
pnode[0].insert(1, nodes.Text(' '))
|
||||||
|
else:
|
||||||
|
pnode.insert(0, nodes.paragraph('', '', add_text))
|
||||||
return [pnode]
|
return [pnode]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue