## The non-local interwiki case here continues to be legacy escaped because of the
## default setting of $wgExternalInterwikiFragmentMode
!! test
Link scenarios with escaped fragments
!! options
title=[[Main Page]]
!! config
wgFragmentMode=[ "html5", "legacy" ]
!! wikitext
[[#Is this great?]]
[[Foo#Is this great?]]
[[meatball:Foo#Is this great?]]
[[:en:Foo#Is this great?]]
!! html/php
<p><a href="#Is_this_great?">#Is this great?</a>
<a href="/wiki/Foo#Is_this_great?" title="Foo">Foo#Is this great?</a>
<a href="http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great.3F" class="extiw" title="meatball:Foo">meatball:Foo#Is this great?</a>
<a href="//en.wikipedia.org/wiki/Foo#Is_this_great?" class="extiw" title="en:Foo">en:Foo#Is this great?</a>
</p>
!! html/parsoid
<p><a rel="mw:WikiLink" href="./Main_Page#Is_this_great?" class="mw-selflink-fragment" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#Is_this_great?"},"sa":{"href":"#Is this great?"}}'>#Is this great?</a>
<a rel="mw:WikiLink" href="./Foo#Is_this_great?" title="Foo" data-parsoid='{"stx":"simple","a":{"href":"./Foo#Is_this_great?"},"sa":{"href":"Foo#Is this great?"}}'>Foo#Is this great?</a>
<a rel="mw:WikiLink/Interwiki" href="http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great.3F" title="meatball:Foo" class="extiw" data-parsoid='{"stx":"simple","a":{"href":"http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great.3F"},"sa":{"href":"meatball:Foo#Is this great?"},"isIW":true}'>meatball:Foo#Is this great?</a>
<a rel="mw:WikiLink/Interwiki" href="//en.wikipedia.org/wiki/Foo#Is_this_great?" title="en:Foo" class="extiw">en:Foo#Is this great?</a></p>
!! end
!! test
Link scenarios with escaped fragments (legacy)
!! config
wgFragmentMode=[ "legacy" ]
!! wikitext
[[#Is this great?]]
[[Foo#Is this great?]]
[[meatball:Foo#Is this great?]]
!! html/php
<p><a href="#Is_this_great.3F">#Is this great?</a>
<a href="/wiki/Foo#Is_this_great.3F" title="Foo">Foo#Is this great?</a>
<a href="http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great.3F" class="extiw" title="meatball:Foo">meatball:Foo#Is this great?</a>
</p>
!! end
# Ideally the wikipedia: prefix here should be proto-relative too
# [CSA]: this is kind of a bogus test, as the PHP parser test doesn't
# define the 'en' prefix, and originally the test used 'wikipedia',
# which isn't a localinterwiki prefix hence the links to the 'en:Foo'
# article.
!! test
Different interwiki prefixes mapping to the same URL
<p><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":" wikiPEdia :Foo"},"isIW":true}' title="wikipedia:Foo" class="extiw"> wikiPEdia :Foo</a></p>
!! end
!! test
Interwiki links that cannot be represented in wiki syntax
!! wikitext
[[meatball:ok]]
[[meatball:ok#foo|ok with fragment]]
[[meatball:ok_as_well?|ok ending with ? mark]]
[http://de.wikipedia.org/wiki/Foo?action=history has query]
[http://de.wikipedia.org/wiki/#foo is just fragment]