refactor: avoid parsing document twice for figure numbers

This commit is contained in:
Tim Grelka
2026-06-24 16:18:39 +02:00
parent c15b3f709b
commit f6ceb4cf49
32 changed files with 263 additions and 349 deletions
+6 -3
View File
@@ -2,6 +2,9 @@ import mistletoe
class Document(mistletoe.Document):
# margin_count = 0
# margin_anchor_count = 0
references = {}
def __init__(self, *args, **kwargs):
# references must exist before super().__init__ tokenizes the lines,
# since ReferencedToken reads it from _root_node during tokenization.
self.references: dict[str, str] = {}
super().__init__(*args, **kwargs)