Fixed linenumber missing when audit hook has an error (GH-24692)

See https://github.com/sphinx-doc/sphinx/issues/8932

Co-authored-by: tk0miya <i.tkomiya@gmail.com>
This commit is contained in:
Jules Lasne 2021-03-01 22:59:58 +01:00 committed by GitHub
parent 7c25508263
commit dbfabcc0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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: