From f0a67253e7b54289cf0a4aadf1b42a9bf9719215 Mon Sep 17 00:00:00 2001 From: Jules Lasne Date: Mon, 1 Mar 2021 21:21:30 +0100 Subject: [PATCH] Fixed linenumber missing when audit hook has an error See https://github.com/sphinx-doc/sphinx/issues/8932 Co-authored-by: tk0miya --- Doc/tools/extensions/pyspecific.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 28994399e25cf9..bcd9d26b36846f 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -224,6 +224,7 @@ def run(self): info['source'].append((env.docname, target)) pnode = nodes.paragraph(text, classes=["audit-hook"], ids=ids) + pnode.line = self.lineno if self.content: self.state.nested_parse(self.content, self.content_offset, pnode) else: