You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@peterzjx more thna a year late, but fixed the bug but avoiding searching DictContainers
Reopening though as a better approach might be to walk looking for Str(keyword) and then flagging the parent object for latter replacement. Because .walk() breaks if we replace the parent object, an alternative might be to instead flag it (add it to a set) and then do a second round where we replace the parent objects we flagged.
Here is a minimal working sample, for a latex document input (
main.bib
doesn't have to present):with a
finalize
filter callingreplace_keyword
replacing with a blockThe pre-finalized generated AST looks like
The problem seems to originate from the code base
panflute/tools.py
line 493where in this case,
e.content
could be aDictContainer('bibliography')
and fails to retreivee.content[0]
.It seems necessary to ensure
e.content
to be aListContainer
but I'm not sure if any other type is also allowed here.The text was updated successfully, but these errors were encountered: