refactor: avoid parsing document twice for figure numbers
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user