While it's not usual, it's possible to have some nested "ignoretags" in filters, so something like:
<a href="url">whatever<span class="nolink">text</span></a> (with nested <a> and "nolink" ignoretags)
is transformed to:
This is caused by filterlib, trying to rebuild ignoretags in the SAME order they were found. By simply reversing the array of ignoretags, rebuild order is correct and we get the original string ok.