To reproduce:
- Edit a page in the English Wikipedia.
- Write potato. After this text, add a footnote using the {{refn}} template. (Not using the <ref> tag.) Wiki syntax will look like this: potato.{{refn|Also known as tater.}}
- Publish.
- Edit the page again.
- Highlight the text before the footnote, and the footnote.
- Click the Link button in the toolbar.
- Write The Potato Eaters as the link target. Click Done.
- Publish.
Observed: The published wikitext is [[The Potato Eaters|potato.{{refn|Also known as tater.}}]][./User:Amire80/ref+link#cite_note-1 <span class="mw-reflink-text"><nowiki>[1]</nowiki></span>]. You can see an example here.
Expected: The wikitext [./User:Amire80/ref+link#cite_note-1 <span class="mw-reflink-text"><nowiki>[1]</nowiki></span>] is definitely not supposed to be published.
This doesn't happen if instead of using {{refn}} you use an explicit <ref>. In this case the output will be [[The Potato Eaters|potato.]]<ref>Also known as tater.</ref>. This means that VE (or Parsoid) understands that a footnote is not supposed to appear in a link, and quietly truncates what the user highlighted. This is reasonable behavior, and it should also happen when {{refn}} is used.
In the English Wikipedia <ref> is much more common than {{refn}}, but it's still used on more than 20 thousand pages. In some other languages templates of this kind are very common (certainly so in Hebrew).