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>
(cherry picked from commit dbfabcc0c3)

Co-authored-by: Jules Lasne <jules.lasne@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-03-01 14:23:21 -08:00 committed by GitHub
parent 4f9eb3f3d3
commit ff887f38f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,6 +191,7 @@ class AuditEvent(Directive):
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: