Skip to content

Commit 81cd18a

Browse files
committed
fix: Make sure doctree is not None
1 parent 16cbcb8 commit 81cd18a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/sphinxnotes/data/render/datanodes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,8 @@ def replace_self_inline(
163163
ns, msgs = rendered.inline(inliner)
164164

165165
# Insert reports to nearst block elements (usually nodes.paragraph).
166-
blkparent = find_nearest_block_element(self.parent) or find_current_document(
167-
self
168-
)
169-
assert blkparent
166+
doctree = inliner.document if isinstance(inliner, Inliner) else inliner[1]
167+
blkparent = find_nearest_block_element(self.parent) or doctree
170168
blkparent += msgs
171169

172170
# Replace self with inline nodes.

0 commit comments

Comments
 (0)