Steps to replicate the issue (include links if applicable):
A live version of this post can be viewed in my sandbox (permalink)
What happens?:
This template creates an anchor link to a matching id= attribute in a citation template's <cite> tag:
- {{harvnb|Moréri|1759}} → [[#CITEREFMoréri1759|Moréri 1759]] → Moréri 1759
MediaWiki translates the above into this html in:
- desktop view:
- <a href="#CITEREFMoréri1759">Moréri 1759</a>
- mobile view:
- <a href="#CITEREFMor%C3%A9ri1759">Moréri 1759</a>
{{Cite book|last=Moréri |first=Louis |date=1759 |title=Le grand dictionnaire historique ou le mélange curieux de l'histoire sacrée et profane}}
MediaWiki translates the target citation template above into this html in:
- desktop view
- <cite id="CITEREFMoréri1759" class="citation book cs1">...</cite>
- mobile view
- <cite id="CITEREFMoréri1759" class="citation book cs1">...</cite>
The above html snippets were taken from this version of my sandbox (permalink) by using my browser's right-click-view-source
It appears that MediaWiki applies URI encoding to the fragment wikilink when rendering the mobile view:
- {{urlencode:CITEREFMoréri1759}} → CITEREFMor%C3%A9ri1759
when it should be applying anchor encoding as it does when rendering the desktop view:
- {{anchorencode:CITEREFMoréri1759}} → CITEREFMoréri1759
What should have happened instead?:
Use anchor encoding for anchor wikilinks