Skip to content

Commit

Permalink
Don't parse content as arg in the impl-detail directive
Browse files Browse the repository at this point in the history
This does not change the (untranslated) output,
but ensures that the doctree node metadata is correct.
which fixes pythongh-97607 with the text not being translated.
It also simplifies the code and logic
and makes it consistant with the docutils built-in directives.
  • Loading branch information
CAM-Gerlach committed Sep 29, 2022
1 parent 4652093 commit 00e5bcc
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Doc/tools/extensions/pyspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def source_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
class ImplementationDetail(Directive):

has_content = True
required_arguments = 0
optional_arguments = 1
final_argument_whitespace = True

# This text is copied to templates/dummy.html
Expand All @@ -112,9 +110,6 @@ def run(self):
label = translators['sphinx'].gettext(self.label_text)
content = self.content
add_text = nodes.strong(label, label)
if self.arguments:
n, m = self.state.inline_text(self.arguments[0], self.lineno)
pnode.append(nodes.paragraph('', '', *(n + m)))
self.state.nested_parse(content, self.content_offset, pnode)
if pnode.children and isinstance(pnode[0], nodes.paragraph):
content = nodes.inline(pnode[0].rawsource, translatable=True)
Expand Down

0 comments on commit 00e5bcc

Please sign in to comment.