{{#interwikilink:en|Foo|a <ref>....</ref> b}}
doesn't work in Parsoid, for two reasons:
- The <ref> generates an <a> tag, causing an <a>-tag-in-<a>-tag scenario. This is also the case for legacy, and causes the interwikilink to terminate before the final b
- We are in mStripExtTags=false mode in the legacy Parser when we call Parser::recursiveTagParseFully and so the embedded <ref> is not fully parsed to HTML, but it instead either left as-is (ParsoidFragmentMode=='v1') or left as a strip marker (ParsoidFragmentMode=='v2'). We need to either flip out of mStripExtTags mode in the legacy parser or (better) use Parsoid for the recursive parse.