fix: Fix a bug in replacement in deeply-nested inline nodes with content #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It solves the bug described here, for replacements that happen in inline nodes whose content is made of non-inline nodes (e.g. a footnote that contains blocks, like
Notein Pandoc model).The patch looks for the upper node that has no inline ancestors, and it searches backwards until depth 1:
(I realize I forgot indentation on the third line in my PR, you should fix it, sorry @marijnh )
Maybe this is more efficient (but I have not tested it):
I went with another solution (see attached patch) instead.
A solution with less computations, fine!
Unfortunately that kind of footnotes model is a way of multiplying computations.
Usually you have blocks of blocks, blocks of inlines and, sometimes, inlines of inlines. From roots to leaves.
The Pandoc
Notemodel reopens the cycle, because it's an inline container of blocks, so, in theory, the cycle starts over again. From root to leaves, and then from other roots again.In one of my documents I have even notes inside notes, and I verified this patch works.
Again, thank you!
Pull request closed