Skip to content

Commit

Permalink
fix: offset index out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
shaokeyibb committed Jul 8, 2024
1 parent 1d5fdde commit 5372882
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ def run(self, parent: etree.Element, blocks: list[str]) -> bool:
# append MARK_PREVENT_RECURSION to tail of the block to prevent recursion, we don't use a handled
# flaglist because we don't know if there's some same block in the document
self.parser.parseBlocks(parent, [block + MARK_PREVENT_RECURSION])
# fix offset index out of range
if len(parent) == 0:
return True
# fix multi blocks in same parents
if self.meta["last_parent"] == parent[-1]:
parent[-1].set("data-original-document-end", str(end))
Expand Down

0 comments on commit 5372882

Please sign in to comment.