Using version 0.54.0, here's a minimal reproducible example:
import wikitextparser as wtp
text = """
<ref[oanda.com, March 9, 2022]/ref>
<ref name=cp/>
<ref>a</ref>
"""
parsed = wtp.parse(text)
for reference in parsed.get_tags('ref'):
del reference[:]
wikitextparser/_wikitext.py", line 157, in __add__
raise DeadIndexError(
wikitextparser._wikitext.DeadIndexError: this usually means that the object has died (overwritten or deleted) and cannot be mutated
since the entire text is treated as a reference (resulting in nested references), even though <ref[oanda.com, March 9, 2022]/ref> is not a proper start tag. Instead, it should be left as text.
Using version 0.54.0, here's a minimal reproducible example:
(e.g. https://en.wikipedia.org/wiki/Economy_of_Tajikistan). It errors at
since the entire text is treated as a reference (resulting in nested references), even though
<ref[oanda.com, March 9, 2022]/ref>
is not a proper start tag. Instead, it should be left as text.