r87964 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87963‎ | r87964 | r87965 >
Date:11:41, 13 May 2011
Author:hashar
Status:reverted (Comments)
Tags:
Comment:
merge in prettyURL patch

This is basicly a merge of r84386 & r84491, see their commit messages for
more details.

r84386 makes wikilinks nicer by updating the URL forge implemented by r2621
r84491 fix an issue with the (un)?watch links. getParamValue should not be
used to guess 'title' or 'action'
Modified paths:
  • /trunk/phase3/includes/Setup.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.js (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/TitleTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/TitleTest.php
@@ -14,4 +14,109 @@
1515 }
1616 }
1717 }
 18+
 19+ /**
 20+ * Helper to test getLocalURL
 21+ *
 22+ * @cover Title:getLocalURL
 23+ */
 24+ function assertGetLocalURL( $expected, $dbkey, $query, $articlepath, $actionpaths = array(), $variant = false )
 25+ {
 26+ global $wgArticlePath;
 27+ $wgArticlePath = $articlepath;
 28+ global $wgActionPaths;
 29+ $wgActionPaths = $actionpaths;
 30+
 31+ $t = Title::newFromDBKey( $dbkey );
 32+
 33+ $this->assertEquals( $expected, $t->getLocalURL( $query, $variant ) );
 34+ }
 35+
 36+ /**
 37+ * @dataProvider provider1
 38+ * @cover Title:getLocalURL
 39+ */
 40+ function testGetLocalUrl( $expected, $dbkey, $query )
 41+ {
 42+ $this->assertGetLocalURL( $expected, $dbkey, $query, '/wiki/$1' );
 43+ }
 44+
 45+ function provider1()
 46+ {
 47+ return array(
 48+ array( '/wiki/Recentchanges', 'Recentchanges', '' ),
 49+ array( '/wiki/Recentchanges?foo=2', 'Recentchanges', 'foo=2' ),
 50+ array( '/wiki/Recentchanges?foo=A&bar=1', 'Recentchanges', 'foo=A&bar=1' ),
 51+ );
 52+ }
 53+
 54+
 55+ /**
 56+ * @dataProvider provider2
 57+ * @cover Title:getLocalURL
 58+ */
 59+ function testGetLocalUrlWithArticlePath( $expected, $dbkey, $query, $actions )
 60+ {
 61+ $this->assertGetLocalURL( $expected, $dbkey, $query, '/wiki/view/$1', $actions );
 62+ }
 63+
 64+ function provider2()
 65+ {
 66+ return array(
 67+ array( '/wiki/view/Recentchanges', 'Recentchanges', '', array( ) ),
 68+ array( '/wiki/view/Recentchanges', 'Recentchanges', '', array( 'view' => 'OH MEN' ) ),
 69+ array( '/wiki/view/Recentchanges', 'Recentchanges', '', array( 'view' => '/wiki/view/$1' ) ),
 70+ array( '/wiki/view/Recentchanges?foo=2', 'Recentchanges', 'foo=2', array( 'view' => '/wiki/view/$1' ) ),
 71+ array( '/wiki/view/Recentchanges?foo=A&bar=1', 'Recentchanges', 'foo=A&bar=1', array() ),
 72+ );
 73+ }
 74+
 75+
 76+ /**
 77+ * @dataProvider provider3
 78+ * @cover Title:getLocalURL
 79+ */
 80+ function testGetLocalUrlWithActionPaths( $expected, $dbkey, $query )
 81+ {
 82+ $actions = array( 'edit' => '/wiki/edit/$1' );
 83+ $this->assertGetLocalURL( $expected, $dbkey, $query, '/wiki/view/$1', $actions );
 84+ }
 85+
 86+ function provider3() {
 87+ return array(
 88+ array( '/wiki/view/Recentchanges', 'Recentchanges', ''),
 89+ array( '/wiki/edit/Recentchanges', 'Recentchanges', 'action=edit' ),
 90+ array( '/wiki/edit/Recentchanges?foo=2', 'Recentchanges', 'action=edit&foo=2' ),
 91+ array( '/wiki/edit/Recentchanges?foo=2', 'Recentchanges', 'foo=2&action=edit' ),
 92+ array( '/wiki/view/Recentchanges?foo=A&bar=1', 'Recentchanges', 'foo=A&bar=1' ),
 93+ array( '/wiki/edit/Recentchanges?foo=A&bar=1', 'Recentchanges', 'foo=A&bar=1&action=edit' ),
 94+ array( '/wiki/edit/Recentchanges?foo=A&bar=1', 'Recentchanges', 'foo=A&action=edit&bar=1' ),
 95+ array( '/wiki/edit/Recentchanges?foo=A&bar=1', 'Recentchanges', 'action=edit&foo=A&bar=1' ),
 96+
 97+ # FIXME The next two are equals but need investigation:
 98+ array( '/wiki/edit/Recentchanges', 'Recentchanges', 'action=view&action=edit' ),
 99+ array( '/wiki/view/Recentchanges?action=edit&action=view', 'Recentchanges', 'action=edit&action=view' ),
 100+ );
 101+ }
 102+
 103+ /**
 104+ * @dataProvider provider4
 105+ * @cover Title:getLocalURL
 106+ */
 107+ function testGetLocalUrlWithVariantArticlePaths( $expected, $dbkey, $query )
 108+ {
 109+ # FIXME find a language with variants!
 110+ $this->markTestIncomplete();
 111+
 112+ $actions = array( 'edit' => '/wiki/edit/$1' );
 113+ $this->assertGetLocalURL( $expected, $dbkey, $query, '/wiki/view/$1', array(), '/$2/$1' );
 114+ }
 115+
 116+ function provider4() {
 117+ return array(
 118+ array( '/wiki/view/Recentchanges', 'Recentchanges', '', ),
 119+ );
 120+ }
 121+
 122+
18123 }
Index: trunk/phase3/tests/parser/parserTests.txt
@@ -538,7 +538,7 @@
539539 !! input
540540 ; [[Help:FAQ]]: The least-read page on Wikipedia
541541 !! result
542 -<dl><dt> <a href="https://www.mediawiki.org/index.php?title=Help:FAQ&amp;action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt><dd> The least-read page on Wikipedia
 542+<dl><dt> <a href="https://www.mediawiki.org/wiki/Help:FAQ?action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt><dd> The least-read page on Wikipedia
543543 </dd></dl>
544544
545545 !! end
@@ -971,7 +971,7 @@
972972 !! input
973973 [http://example.com [[wikilink]] embedded in ext link]
974974 !! result
975 -<p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="https://www.mediawiki.org/index.php?title=Wikilink&amp;action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
 975+<p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="https://www.mediawiki.org/wiki/Wikilink?action=edit&amp;redlink=1" class="new" title="Wikilink (page does not exist)">wikilink</a><a rel="nofollow" class="external text" href="http://example.com"> embedded in ext link</a>
976976 </p>
977977 !! end
978978
@@ -1138,7 +1138,7 @@
11391139 !! input
11401140 [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
11411141 !! result
1142 -<p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="https://www.mediawiki.org/index.php?title=Museo_Picasso_(Par%C3%ADs)&amp;action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
 1142+<p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="https://www.mediawiki.org/wiki/Museo_Picasso_(Par%C3%ADs)?action=edit&amp;redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
11431143 </p>
11441144 !! end
11451145
@@ -1147,7 +1147,7 @@
11481148 !! input
11491149 {{localurl:Some page|amp=&}}
11501150 !! result
1151 -<p>/index.php?title=Some_page&amp;amp=&amp;
 1151+<p>/wiki/Some_page?amp=&amp;
11521152 </p>
11531153 !! end
11541154
@@ -1156,7 +1156,7 @@
11571157 !! input
11581158 {{localurl:Some page|q=?&amp=&}}
11591159 !! result
1160 -<p>/index.php?title=Some_page&amp;q=?&amp;amp=&amp;
 1160+<p>/wiki/Some_page?q=?&amp;amp=&amp;
11611161 </p>
11621162 !! end
11631163
@@ -1757,7 +1757,7 @@
17581758 <table>
17591759 <tr valign="top">
17601760 <td>
1761 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Heading">edit</a>]</span> <span class="mw-headline" id="Heading"> Heading </span></h3>
 1761+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Heading">edit</a>]</span> <span class="mw-headline" id="Heading"> Heading </span></h3>
17621762 </td>
17631763 </tr>
17641764 </table>
@@ -1938,7 +1938,7 @@
19391939 !! input
19401940 [[Zigzagzogzagzig]]
19411941 !! result
1942 -<p><a href="https://www.mediawiki.org/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig</a>
 1942+<p><a href="https://www.mediawiki.org/wiki/Zigzagzogzagzig?action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig</a>
19431943 </p>
19441944 !! end
19451945
@@ -1947,7 +1947,7 @@
19481948 !! input
19491949 [[Zigzagzogzagzig#zug]]
19501950 !! result
1951 -<p><a href="https://www.mediawiki.org/index.php?title=Zigzagzogzagzig&amp;action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig#zug</a>
 1951+<p><a href="https://www.mediawiki.org/wiki/Zigzagzogzagzig?action=edit&amp;redlink=1" class="new" title="Zigzagzogzagzig (page does not exist)">Zigzagzogzagzig#zug</a>
19521952 </p>
19531953 !! end
19541954
@@ -2019,7 +2019,7 @@
20202020 !! input
20212021 [[Talk:Parser testing]], [[Meta:Disclaimers]]
20222022 !! result
2023 -<p><a href="https://www.mediawiki.org/index.php?title=Talk:Parser_testing&amp;action=edit&amp;redlink=1" class="new" title="Talk:Parser testing (page does not exist)">Talk:Parser testing</a>, <a href="https://www.mediawiki.org/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">Meta:Disclaimers</a>
 2023+<p><a href="https://www.mediawiki.org/wiki/Talk:Parser_testing?action=edit&amp;redlink=1" class="new" title="Talk:Parser testing (page does not exist)">Talk:Parser testing</a>, <a href="https://www.mediawiki.org/wiki/Meta:Disclaimers?action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">Meta:Disclaimers</a>
20242024 </p>
20252025 !! end
20262026
@@ -2028,7 +2028,7 @@
20292029 !! input
20302030 [[Meta:Disclaimers|The disclaimers]]
20312031 !! result
2032 -<p><a href="https://www.mediawiki.org/index.php?title=Meta:Disclaimers&amp;action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">The disclaimers</a>
 2032+<p><a href="https://www.mediawiki.org/wiki/Meta:Disclaimers?action=edit&amp;redlink=1" class="new" title="Meta:Disclaimers (page does not exist)">The disclaimers</a>
20332033 </p>
20342034 !! end
20352035
@@ -2046,7 +2046,7 @@
20472047 !! input
20482048 [[7% Solution]]
20492049 !! result
2050 -<p><a href="https://www.mediawiki.org/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
 2050+<p><a href="https://www.mediawiki.org/wiki/7%25_Solution?action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
20512051 </p>
20522052 !! end
20532053
@@ -2055,7 +2055,7 @@
20562056 !! input
20572057 [[7%25 Solution]]
20582058 !! result
2059 -<p><a href="https://www.mediawiki.org/index.php?title=7%25_Solution&amp;action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
 2059+<p><a href="https://www.mediawiki.org/wiki/7%25_Solution?action=edit&amp;redlink=1" class="new" title="7% Solution (page does not exist)">7% Solution</a>
20602060 </p>
20612061 !!end
20622062
@@ -2092,7 +2092,7 @@
20932093 !! input
20942094 [[Lista d''e paise d''o munno]]
20952095 !! result
2096 -<p><a href="https://www.mediawiki.org/index.php?title=Lista_d%27%27e_paise_d%27%27o_munno&amp;action=edit&amp;redlink=1" class="new" title="Lista d''e paise d''o munno (page does not exist)">Lista d''e paise d''o munno</a>
 2096+<p><a href="https://www.mediawiki.org/wiki/Lista_d%27%27e_paise_d%27%27o_munno?action=edit&amp;redlink=1" class="new" title="Lista d''e paise d''o munno (page does not exist)">Lista d''e paise d''o munno</a>
20972097 </p>
20982098 !! end
20992099
@@ -2101,7 +2101,7 @@
21022102 !! input
21032103 Some [[Link|pretty ''italics'' and stuff]]!
21042104 !! result
2105 -<p>Some <a href="https://www.mediawiki.org/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
 2105+<p>Some <a href="https://www.mediawiki.org/wiki/Link?action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
21062106 </p>
21072107 !! end
21082108
@@ -2110,7 +2110,7 @@
21112111 !! input
21122112 ''Some [[Link|pretty ''italics'' and stuff]]!
21132113 !! result
2114 -<p><i>Some <a href="https://www.mediawiki.org/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!</i>
 2114+<p><i>Some <a href="https://www.mediawiki.org/wiki/Link?action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!</i>
21152115 </p>
21162116 !! end
21172117
@@ -2125,10 +2125,10 @@
21262126
21272127 [[''Pentecoste''|''Pentecoste'']]
21282128 !! result
2129 -<p><a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Denys_Savchenko_%27%27Pentecoste%27%27.jpg" class="new" title="File:Denys Savchenko &#39;&#39;Pentecoste&#39;&#39;.jpg">File:Denys Savchenko <i>Pentecoste</i>.jpg</a>
2130 -</p><p><a href="https://www.mediawiki.org/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">''Pentecoste''</a>
2131 -</p><p><a href="https://www.mediawiki.org/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">Pentecoste</a>
2132 -</p><p><a href="https://www.mediawiki.org/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)"><i>Pentecoste</i></a>
 2129+<p><a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=Denys_Savchenko_%27%27Pentecoste%27%27.jpg" class="new" title="File:Denys Savchenko &#39;&#39;Pentecoste&#39;&#39;.jpg">File:Denys Savchenko <i>Pentecoste</i>.jpg</a>
 2130+</p><p><a href="https://www.mediawiki.org/wiki/%27%27Pentecoste%27%27?action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">''Pentecoste''</a>
 2131+</p><p><a href="https://www.mediawiki.org/wiki/%27%27Pentecoste%27%27?action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)">Pentecoste</a>
 2132+</p><p><a href="https://www.mediawiki.org/wiki/%27%27Pentecoste%27%27?action=edit&amp;redlink=1" class="new" title="''Pentecoste'' (page does not exist)"><i>Pentecoste</i></a>
21332133 </p>
21342134 !! end
21352135
@@ -2148,7 +2148,7 @@
21492149 # ----
21502150 # I'm changing it to match the current output--it arguably makes more
21512151 # sense in the light of the test above. Old expected result was:
2152 -#<p>Piped link to URL: <a href="https://www.mediawiki.org/index.php?title=Http://www.example.com&amp;action=edit" class="new">an example URL</a>
 2152+#<p>Piped link to URL: <a href="https://www.mediawiki.org/wiki/Http://www.example.com?action=edit" class="new">an example URL</a>
21532153 #</p>
21542154 # But I think this test is bordering on "garbage in, garbage out" anyway.
21552155 # -- wtm
@@ -2267,7 +2267,7 @@
22682268 !! input
22692269 [[Something]]'nice
22702270 !! result
2271 -<p><a href="https://www.mediawiki.org/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (page does not exist)">Something</a>'nice
 2271+<p><a href="https://www.mediawiki.org/wiki/Something?action=edit&amp;redlink=1" class="new" title="Something (page does not exist)">Something</a>'nice
22722272 </p>
22732273 !! end
22742274
@@ -2278,7 +2278,7 @@
22792279 !! input
22802280 [[Something]]'nice
22812281 !! result
2282 -<p><a href="https://www.mediawiki.org/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (encara no existeix)">Something'nice</a>
 2282+<p><a href="https://www.mediawiki.org/wiki/Something?action=edit&amp;redlink=1" class="new" title="Something (encara no existeix)">Something'nice</a>
22832283 </p>
22842284 !! end
22852285
@@ -2289,7 +2289,7 @@
22902290 !! input
22912291 [[Something]]'nice
22922292 !! result
2293 -<p><a href="https://www.mediawiki.org/index.php?title=Something&amp;action=edit&amp;redlink=1" class="new" title="Something (bet ele jaratılmag'an)">Something'nice</a>
 2293+<p><a href="https://www.mediawiki.org/wiki/Something?action=edit&amp;redlink=1" class="new" title="Something (bet ele jaratılmag'an)">Something'nice</a>
22942294 </p>
22952295 !! end
22962296
@@ -2909,7 +2909,7 @@
29102910 !! input
29112911 [[RFC 123]]
29122912 !! result
2913 -<p><a href="https://www.mediawiki.org/index.php?title=RFC_123&amp;action=edit&amp;redlink=1" class="new" title="RFC 123 (page does not exist)">RFC 123</a>
 2913+<p><a href="https://www.mediawiki.org/wiki/RFC_123?action=edit&amp;redlink=1" class="new" title="RFC 123 (page does not exist)">RFC 123</a>
29142914 </p>
29152915 !! end
29162916
@@ -2949,7 +2949,7 @@
29502950 !! input
29512951 {{thistemplatedoesnotexist}}
29522952 !! result
2953 -<p><a href="https://www.mediawiki.org/index.php?title=Template:Thistemplatedoesnotexist&amp;action=edit&amp;redlink=1" class="new" title="Template:Thistemplatedoesnotexist (page does not exist)">Template:Thistemplatedoesnotexist</a>
 2953+<p><a href="https://www.mediawiki.org/wiki/Template:Thistemplatedoesnotexist?action=edit&amp;redlink=1" class="new" title="Template:Thistemplatedoesnotexist (page does not exist)">Template:Thistemplatedoesnotexist</a>
29542954 </p>
29552955 !! end
29562956
@@ -3131,7 +3131,7 @@
31323132 {{paramtest|
31333133 param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
31343134 !! result
3135 -This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="https://www.mediawiki.org/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="https://www.mediawiki.org/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
 3135+This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="https://www.mediawiki.org/wiki/No_link?action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="https://www.mediawiki.org/wiki/No_link?action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
31363136
31373137 !! end
31383138
@@ -3435,8 +3435,8 @@
34363436 !! input
34373437 {{includeonly section}}
34383438 !! result
3439 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-1" title="Template:Includeonly section">edit</a>]</span> <span class="mw-headline" id="Includeonly_section">Includeonly section</span></h2>
3440 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-2" title="Template:Includeonly section">edit</a>]</span> <span class="mw-headline" id="Section_T-1">Section T-1</span></h2>
 3439+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Template:Includeonly_section?action=edit&amp;section=T-1" title="Template:Includeonly section">edit</a>]</span> <span class="mw-headline" id="Includeonly_section">Includeonly section</span></h2>
 3440+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Template:Includeonly_section?action=edit&amp;section=T-2" title="Template:Includeonly section">edit</a>]</span> <span class="mw-headline" id="Section_T-1">Section T-1</span></h2>
34413441
34423442 !! end
34433443
@@ -3462,7 +3462,7 @@
34633463 </includeonly>
34643464 ==Section 1==
34653465 !! result
3466 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h2>
 3466+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Section 1">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h2>
34673467
34683468 !! end
34693469
@@ -4103,7 +4103,7 @@
41044104 !! input
41054105 [[:Image:test]]
41064106 !! result
4107 -<p><a href="https://www.mediawiki.org/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">Image:test</a>
 4107+<p><a href="https://www.mediawiki.org/wiki/File:Test?action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">Image:test</a>
41084108 </p>
41094109 !! end
41104110
@@ -4112,7 +4112,7 @@
41134113 !! input
41144114 [[:Image:test|caption]]
41154115 !! result
4116 -<p><a href="https://www.mediawiki.org/index.php?title=File:Test&amp;action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">caption</a>
 4116+<p><a href="https://www.mediawiki.org/wiki/File:Test?action=edit&amp;redlink=1" class="new" title="File:Test (page does not exist)">caption</a>
41174117 </p>
41184118 !! end
41194119
@@ -4239,7 +4239,7 @@
42404240 !! input
42414241 [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]]
42424242 !! result
4243 -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Icon.png" class="new" title="File:Icon.png">image</a> inside it!</div></div></div>
 4243+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="180" height="20" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="https://www.mediawiki.org/wiki/File:Foobar.jpg" class="internal" title="Enlarge"><img src="/skins/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>This is a caption with another <a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=Icon.png" class="new" title="File:Icon.png">image</a> inside it!</div></div></div>
42444244
42454245 !! end
42464246
@@ -4326,7 +4326,7 @@
43274327 !! input
43284328 [[/subpage]]
43294329 !! result
4330 -<p><a href="https://www.mediawiki.org/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a>
 4330+<p><a href="https://www.mediawiki.org/wiki//subpage?action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a>
43314331 </p>
43324332 !! end
43334333
@@ -4337,7 +4337,7 @@
43384338 !! input
43394339 {{/Subpage}}
43404340 !! result
4341 -<p><a href="https://www.mediawiki.org/index.php?title=Page/Subpage&amp;action=edit&amp;redlink=1" class="new" title="Page/Subpage (page does not exist)">Page/Subpage</a>
 4341+<p><a href="https://www.mediawiki.org/wiki/Page/Subpage?action=edit&amp;redlink=1" class="new" title="Page/Subpage (page does not exist)">Page/Subpage</a>
43424342 </p>
43434343 !! end
43444344
@@ -4407,13 +4407,13 @@
44084408 ===Smaller headline===
44094409 Blah blah
44104410 !! result
4411 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline" id="Headline_1"> Headline 1 </span></h2>
 4411+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline" id="Headline_1"> Headline 1 </span></h2>
44124412 <p>Some text
44134413 </p>
4414 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline" id="Headline_2">Headline 2</span></h2>
 4414+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline" id="Headline_2">Headline 2</span></h2>
44154415 <p>More
44164416 </p>
4417 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline" id="Smaller_headline">Smaller headline</span></h3>
 4417+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline" id="Smaller_headline">Smaller headline</span></h3>
44184418 <p>Blah blah
44194419 </p>
44204420 !! end
@@ -4452,14 +4452,14 @@
44534453 </li>
44544454 </ul>
44554455 </td></tr></table>
4456 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline" id="Headline_1"> Headline 1 </span></h2>
4457 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Subheadline 1">edit</a>]</span> <span class="mw-headline" id="Subheadline_1"> Subheadline 1 </span></h3>
4458 -<h5><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline" id="Skipping_a_level"> Skipping a level </span></h5>
4459 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline" id="Skipping_a_level_2"> Skipping a level </span></h6>
4460 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline" id="Headline_2"> Headline 2 </span></h2>
 4456+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline" id="Headline_1"> Headline 1 </span></h2>
 4457+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Subheadline 1">edit</a>]</span> <span class="mw-headline" id="Subheadline_1"> Subheadline 1 </span></h3>
 4458+<h5><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline" id="Skipping_a_level"> Skipping a level </span></h5>
 4459+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline" id="Skipping_a_level_2"> Skipping a level </span></h6>
 4460+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline" id="Headline_2"> Headline 2 </span></h2>
44614461 <p>Some text
44624462 </p>
4463 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Another headline">edit</a>]</span> <span class="mw-headline" id="Another_headline">Another headline</span></h3>
 4463+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=6" title="Edit section: Another headline">edit</a>]</span> <span class="mw-headline" id="Another_headline">Another headline</span></h3>
44644464
44654465 !! end
44664466
@@ -4507,16 +4507,16 @@
45084508 </li>
45094509 </ul>
45104510 </td></tr></table>
4511 -<h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Level 1 Heading">edit</a>]</span> <span class="mw-headline" id="Level_1_Heading"> Level 1 Heading</span></h1>
4512 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Level 2 Heading">edit</a>]</span> <span class="mw-headline" id="Level_2_Heading"> Level 2 Heading</span></h2>
4513 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Level 3 Heading">edit</a>]</span> <span class="mw-headline" id="Level_3_Heading"> Level 3 Heading</span></h3>
4514 -<h4><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a>]</span> <span class="mw-headline" id="Level_4_Heading"> Level 4 Heading</span></h4>
4515 -<h5><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a>]</span> <span class="mw-headline" id="Level_5_Heading"> Level 5 Heading</span></h5>
4516 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a>]</span> <span class="mw-headline" id="Level_6_Heading"> Level 6 Heading</span></h6>
4517 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a>]</span> <span class="mw-headline" id=".3D_Level_7_Heading.3D">= Level 7 Heading=</span></h6>
4518 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a>]</span> <span class="mw-headline" id=".3D.3D_Level_8_Heading.3D.3D">== Level 8 Heading==</span></h6>
4519 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a>]</span> <span class="mw-headline" id=".3D.3D.3D_Level_9_Heading.3D.3D.3D">=== Level 9 Heading===</span></h6>
4520 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline" id=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D">==== Level 10 Heading====</span></h6>
 4511+<h1><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Level 1 Heading">edit</a>]</span> <span class="mw-headline" id="Level_1_Heading"> Level 1 Heading</span></h1>
 4512+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Level 2 Heading">edit</a>]</span> <span class="mw-headline" id="Level_2_Heading"> Level 2 Heading</span></h2>
 4513+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: Level 3 Heading">edit</a>]</span> <span class="mw-headline" id="Level_3_Heading"> Level 3 Heading</span></h3>
 4514+<h4><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a>]</span> <span class="mw-headline" id="Level_4_Heading"> Level 4 Heading</span></h4>
 4515+<h5><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a>]</span> <span class="mw-headline" id="Level_5_Heading"> Level 5 Heading</span></h5>
 4516+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a>]</span> <span class="mw-headline" id="Level_6_Heading"> Level 6 Heading</span></h6>
 4517+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a>]</span> <span class="mw-headline" id=".3D_Level_7_Heading.3D">= Level 7 Heading=</span></h6>
 4518+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a>]</span> <span class="mw-headline" id=".3D.3D_Level_8_Heading.3D.3D">== Level 8 Heading==</span></h6>
 4519+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a>]</span> <span class="mw-headline" id=".3D.3D.3D_Level_9_Heading.3D.3D.3D">=== Level 9 Heading===</span></h6>
 4520+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline" id=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D">==== Level 10 Heading====</span></h6>
45214521
45224522 !! end
45234523
@@ -4549,12 +4549,12 @@
45504550 </li>
45514551 </ul>
45524552 </td></tr></table>
4553 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
4554 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
4555 -<h4><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 1.1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1.1"> title 1.1.1 </span></h4>
4556 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: title 1.2">edit</a>]</span> <span class="mw-headline" id="title_1.2"> title 1.2 </span></h3>
4557 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
4558 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: title 2.1">edit</a>]</span> <span class="mw-headline" id="title_2.1"> title 2.1 </span></h3>
 4553+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
 4554+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
 4555+<h4><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: title 1.1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1.1"> title 1.1.1 </span></h4>
 4556+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: title 1.2">edit</a>]</span> <span class="mw-headline" id="title_1.2"> title 1.2 </span></h3>
 4557+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
 4558+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=6" title="Edit section: title 2.1">edit</a>]</span> <span class="mw-headline" id="title_2.1"> title 2.1 </span></h3>
45594559
45604560 !! end
45614561
@@ -4585,12 +4585,12 @@
45864586 </li>
45874587 </ul>
45884588 </td></tr></table>
4589 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
4590 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
4591 -<h4><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 1.1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1.1"> title 1.1.1 </span></h4>
4592 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: title 1.2">edit</a>]</span> <span class="mw-headline" id="title_1.2"> title 1.2 </span></h3>
4593 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
4594 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: title 2.1">edit</a>]</span> <span class="mw-headline" id="title_2.1"> title 2.1 </span></h3>
 4589+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
 4590+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
 4591+<h4><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: title 1.1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1.1"> title 1.1.1 </span></h4>
 4592+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: title 1.2">edit</a>]</span> <span class="mw-headline" id="title_1.2"> title 1.2 </span></h3>
 4593+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
 4594+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=6" title="Edit section: title 2.1">edit</a>]</span> <span class="mw-headline" id="title_2.1"> title 2.1 </span></h3>
45954595
45964596 !! end
45974597
@@ -4615,11 +4615,11 @@
46164616 <li class="toclevel-1 tocsection-5"><a href="#Section_2"><span class="tocnumber">2</span> <span class="toctext">Section 2</span></a></li>
46174617 </ul>
46184618 </td></tr></table>
4619 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 1">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h2>
4620 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Section 1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1">Section 1.1</span></h3>
4621 -<h4><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Section 1.1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1.1">Section 1.1.1</span></h4>
4622 -<h4><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Section 1.1.1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1.1.1">Section 1.1.1.1</span></h4>
4623 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Section 2">edit</a>]</span> <span class="mw-headline" id="Section_2">Section 2</span></h2>
 4619+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Section 1">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h2>
 4620+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Section 1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1">Section 1.1</span></h3>
 4621+<h4><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: Section 1.1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1.1">Section 1.1.1</span></h4>
 4622+<h4><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: Section 1.1.1.1">edit</a>]</span> <span class="mw-headline" id="Section_1.1.1.1">Section 1.1.1.1</span></h4>
 4623+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: Section 2">edit</a>]</span> <span class="mw-headline" id="Section_2">Section 2</span></h2>
46244624
46254625 !! end
46264626
@@ -4630,8 +4630,8 @@
46314631 == Foo bar ==
46324632 == Foo bar ==
46334633 !! result
4634 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar"> Foo bar </span></h2>
4635 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar_2"> Foo bar </span></h2>
 4634+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar"> Foo bar </span></h2>
 4635+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar_2"> Foo bar </span></h2>
46364636
46374637 !! end
46384638
@@ -4641,8 +4641,8 @@
46424642 == Foo bar ==
46434643 == Foo Bar ==
46444644 !! result
4645 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar"> Foo bar </span></h2>
4646 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> Foo Bar </span></h2>
 4645+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline" id="Foo_bar"> Foo bar </span></h2>
 4646+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a>]</span> <span class="mw-headline" id="Foo_Bar_2"> Foo Bar </span></h2>
46474647
46484648 !! end
46494649
@@ -4661,10 +4661,10 @@
46624662 {{sections}}
46634663 ==Section 4==
46644664 !! result
4665 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a>]</span> <span class="mw-headline" id="Section_0">Section 0</span></h2>
4666 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Template:Sections&amp;action=edit&amp;section=T-1" title="Template:Sections">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h3>
4667 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Template:Sections&amp;action=edit&amp;section=T-2" title="Template:Sections">edit</a>]</span> <span class="mw-headline" id="Section_2">Section 2</span></h2>
4668 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline" id="Section_4">Section 4</span></h2>
 4665+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Section 0">edit</a>]</span> <span class="mw-headline" id="Section_0">Section 0</span></h2>
 4666+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Template:Sections?action=edit&amp;section=T-1" title="Template:Sections">edit</a>]</span> <span class="mw-headline" id="Section_1">Section 1</span></h3>
 4667+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Template:Sections?action=edit&amp;section=T-2" title="Template:Sections">edit</a>]</span> <span class="mw-headline" id="Section_2">Section 2</span></h2>
 4668+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline" id="Section_4">Section 4</span></h2>
46694669
46704670 !! end
46714671
@@ -4685,7 +4685,7 @@
46864686 !! input
46874687 ==Section with a [[Main Page|link]] in it==
46884688 !! result
4689 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a>]</span> <span class="mw-headline" id="Section_with_a_link_in_it">Section with a <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">link</a> in it</span></h2>
 4689+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a>]</span> <span class="mw-headline" id="Section_with_a_link_in_it">Section with a <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">link</a> in it</span></h2>
46904690
46914691 !! end
46924692
@@ -4707,9 +4707,9 @@
47084708 <li class="toclevel-1 tocsection-3"><a href="#title_2"><span class="tocnumber">2</span> <span class="toctext">title 2</span></a></li>
47094709 </ul>
47104710 </td></tr></table>
4711 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
4712 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
4713 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
 4711+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: title 1">edit</a>]</span> <span class="mw-headline" id="title_1"> title 1 </span></h2>
 4712+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: title 1.1">edit</a>]</span> <span class="mw-headline" id="title_1.1"> title 1.1 </span></h3>
 4713+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: title 2">edit</a>]</span> <span class="mw-headline" id="title_2"> title 2 </span></h2>
47144714
47154715 !! end
47164716
@@ -4731,10 +4731,10 @@
47324732 --> <!-- -->
47334733 But just in case it doesn't...
47344734 !! result
4735 -<h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D">=</span></h1>
 4735+<h1><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D">=</span></h1>
47364736 <p>The line above must have a trailing space!
47374737 </p>
4738 -<h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D_2">=</span></h1>
 4738+<h1><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: =">edit</a>]</span> <span class="mw-headline" id=".3D_2">=</span></h1>
47394739 <p>But just in case it doesn't...
47404740 </p>
47414741 !! end
@@ -4770,19 +4770,19 @@
47714771 <li class="toclevel-1 tocsection-5"><a href="#text_.22_text"><span class="tocnumber">5</span> <span class="toctext">text " text</span></a></li>
47724772 </ul>
47734773 </td></tr></table>
4774 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: text > text">edit</a>]</span> <span class="mw-headline" id="text_.3E_text"> text &gt; text </span></h2>
 4774+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: text > text">edit</a>]</span> <span class="mw-headline" id="text_.3E_text"> text &gt; text </span></h2>
47754775 <p>section 1
47764776 </p>
4777 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: text &lt; text">edit</a>]</span> <span class="mw-headline" id="text_.3C_text"> text &lt; text </span></h2>
 4777+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: text &lt; text">edit</a>]</span> <span class="mw-headline" id="text_.3C_text"> text &lt; text </span></h2>
47784778 <p>section 2
47794779 </p>
4780 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: text &amp; text">edit</a>]</span> <span class="mw-headline" id="text_.26_text"> text &amp; text </span></h2>
 4780+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: text &amp; text">edit</a>]</span> <span class="mw-headline" id="text_.26_text"> text &amp; text </span></h2>
47814781 <p>section 3
47824782 </p>
4783 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: text ' text">edit</a>]</span> <span class="mw-headline" id="text_.27_text"> text ' text </span></h2>
 4783+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: text ' text">edit</a>]</span> <span class="mw-headline" id="text_.27_text"> text ' text </span></h2>
47844784 <p>section 4
47854785 </p>
4786 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: text &quot; text">edit</a>]</span> <span class="mw-headline" id="text_.22_text"> text " text </span></h2>
 4786+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: text &quot; text">edit</a>]</span> <span class="mw-headline" id="text_.22_text"> text " text </span></h2>
47874787 <p>section 5
47884788 </p>
47894789 !! end
@@ -4971,7 +4971,7 @@
49724972 !! input
49734973 [[Media:No such.jpg]]
49744974 !! result
4975 -<p><a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="No such.jpg">Media:No such.jpg</a>
 4975+<p><a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=No_such.jpg" class="new" title="No such.jpg">Media:No such.jpg</a>
49764976 </p>
49774977 !! end
49784978
@@ -4980,7 +4980,7 @@
49814981 !! input
49824982 [[Image:No such.jpg]]
49834983 !! result
4984 -<p><a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a>
 4984+<p><a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a>
49854985 </p>
49864986 !! end
49874987
@@ -4989,7 +4989,7 @@
49904990 !! input
49914991 [[:Image:No such.jpg]]
49924992 !! result
4993 -<p><a href="https://www.mediawiki.org/index.php?title=File:No_such.jpg&amp;action=edit&amp;redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a>
 4993+<p><a href="https://www.mediawiki.org/wiki/File:No_such.jpg?action=edit&amp;redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a>
49944994 </p>
49954995 !! end
49964996
@@ -5988,7 +5988,7 @@
59895989 == onmouseover= ==
59905990 http://__TOC__
59915991 !! result
5992 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a>]</span> <span class="mw-headline" id="onmouseover.3D"> onmouseover= </span></h2>
 5992+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a>]</span> <span class="mw-headline" id="onmouseover.3D"> onmouseover= </span></h2>
59935993 http://<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
59945994 <ul>
59955995 <li class="toclevel-1 tocsection-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
@@ -6004,7 +6004,7 @@
60056005 {| STYLE=__TOC__
60066006 |foo
60076007 !! result
6008 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline" id="a">a</span></h2>
 6008+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline" id="a">a</span></h2>
60096009 <table style="&#95;_TOC&#95;_">
60106010 <tr>
60116011 <td>foo
@@ -6325,7 +6325,7 @@
63266326 !! input
63276327 {{MediaWiki:Mainpagexxx}}
63286328 !!result
6329 -<p><a href="https://www.mediawiki.org/index.php?title=MediaWiki:Mainpagexxx&amp;action=edit&amp;redlink=1" class="new" title="MediaWiki:Mainpagexxx (page does not exist)">MediaWiki:Mainpagexxx</a>
 6329+<p><a href="https://www.mediawiki.org/wiki/MediaWiki:Mainpagexxx?action=edit&amp;redlink=1" class="new" title="MediaWiki:Mainpagexxx (page does not exist)">MediaWiki:Mainpagexxx</a>
63306330 </p>
63316331 !! end
63326332
@@ -7243,7 +7243,7 @@
72447244 </li><li> Talk
72457245 </li><li>
72467246 </li><li>
7247 -</li><li> <a href="https://www.mediawiki.org/index.php?title=Template:Dynamic&amp;action=edit&amp;redlink=1" class="new" title="Template:Dynamic (page does not exist)">Template:Dynamic</a>
 7247+</li><li> <a href="https://www.mediawiki.org/wiki/Template:Dynamic?action=edit&amp;redlink=1" class="new" title="Template:Dynamic (page does not exist)">Template:Dynamic</a>
72487248 </li></ul>
72497249
72507250 !! end
@@ -7546,7 +7546,7 @@
75477547 !! input
75487548 RFC [[RFC 1234]]
75497549 !! result
7550 -<p>RFC <a href="https://www.mediawiki.org/index.php?title=RFC_1234&amp;action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
 7550+<p>RFC <a href="https://www.mediawiki.org/wiki/RFC_1234?action=edit&amp;redlink=1" class="new" title="RFC 1234 (page does not exist)">RFC 1234</a>
75517551 </p>
75527552 !! end
75537553
@@ -7680,7 +7680,7 @@
76817681 !! input
76827682 [[../|L2]]
76837683 !! result
7684 -<p><a href="https://www.mediawiki.org/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
 7684+<p><a href="https://www.mediawiki.org/wiki/Subpage_test/L1/L2?action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">L2</a>
76857685 </p>
76867686 !! end
76877687
@@ -7692,7 +7692,7 @@
76937693 !! input
76947694 [[../]]
76957695 !! result
7696 -<p><a href="https://www.mediawiki.org/index.php?title=Subpage_test/L1/L2&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
 7696+<p><a href="https://www.mediawiki.org/wiki/Subpage_test/L1/L2?action=edit&amp;redlink=1" class="new" title="Subpage test/L1/L2 (page does not exist)">Subpage test/L1/L2</a>
76977697 </p>
76987698 !! end
76997699
@@ -7707,8 +7707,8 @@
77087708
77097709 [[../../|L1]]l
77107710 !! result
7711 -<p><a href="https://www.mediawiki.org/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>2
7712 -</p><p><a href="https://www.mediawiki.org/index.php?title=Subpage_test/L1&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1l</a>
 7711+<p><a href="https://www.mediawiki.org/wiki/Subpage_test/L1?action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1</a>2
 7712+</p><p><a href="https://www.mediawiki.org/wiki/Subpage_test/L1?action=edit&amp;redlink=1" class="new" title="Subpage test/L1 (page does not exist)">L1l</a>
77137713 </p>
77147714 !! end
77157715
@@ -7730,7 +7730,7 @@
77317731 !! input
77327732 [[../../////]]
77337733 !! result
7734 -<p><a href="https://www.mediawiki.org/index.php?title=Subpage_test/L1////&amp;action=edit&amp;redlink=1" class="new" title="Subpage test/L1//// (page does not exist)">///</a>
 7734+<p><a href="https://www.mediawiki.org/wiki/Subpage_test/L1////?action=edit&amp;redlink=1" class="new" title="Subpage test/L1//// (page does not exist)">///</a>
77357735 </p>
77367736 !! end
77377737
@@ -7771,7 +7771,7 @@
77727772 !! input
77737773 {{RAW:QUERTY}}
77747774 !! result
7775 -<p><a href="https://www.mediawiki.org/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
 7775+<p><a href="https://www.mediawiki.org/wiki/Template:QUERTY?action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
77767776 </p>
77777777 !! end
77787778
@@ -7808,7 +7808,7 @@
78097809 !! input
78107810 {{MediaWiki:Fake}}
78117811 !! result
7812 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a>]</span> <span class="mw-headline" id="header">header</span></h2>
 7812+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/MediaWiki:Fake?action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a>]</span> <span class="mw-headline" id="header">header</span></h2>
78137813
78147814 !! end
78157815
@@ -7839,12 +7839,12 @@
78407840 </li>
78417841 </ul>
78427842 </td></tr></table>
7843 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2">2</span></h2>
7844 -<h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: 6">edit</a>]</span> <span class="mw-headline" id="6">6</span></h6>
7845 -<h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 3">edit</a>]</span> <span class="mw-headline" id="3">3</span></h3>
7846 -<h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: 1">edit</a>]</span> <span class="mw-headline" id="1">1</span></h1>
7847 -<h5><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: 5">edit</a>]</span> <span class="mw-headline" id="5">5</span></h5>
7848 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2_2">2</span></h2>
 7843+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2">2</span></h2>
 7844+<h6><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=2" title="Edit section: 6">edit</a>]</span> <span class="mw-headline" id="6">6</span></h6>
 7845+<h3><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=3" title="Edit section: 3">edit</a>]</span> <span class="mw-headline" id="3">3</span></h3>
 7846+<h1><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=4" title="Edit section: 1">edit</a>]</span> <span class="mw-headline" id="1">1</span></h1>
 7847+<h5><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=5" title="Edit section: 5">edit</a>]</span> <span class="mw-headline" id="5">5</span></h5>
 7848+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=6" title="Edit section: 2">edit</a>]</span> <span class="mw-headline" id="2_2">2</span></h2>
78497849
78507850 !! end
78517851
@@ -8142,7 +8142,7 @@
81438143 !! input
81448144 == -{Naslov}- ==
81458145 !! result
8146 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
 8146+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Уредите одељак „Naslov“">уреди</a>]</span> <span class="mw-headline" id="-.7BNaslov.7D-"> Naslov </span></h2>
81478147
81488148 !! end
81498149
@@ -8390,7 +8390,7 @@
83918391 !! result
83928392 <p>[[link
83938393 </p>
8394 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
 8394+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
83958395
83968396 !! end
83978397
@@ -8414,7 +8414,7 @@
84158415 !! result
84168416 <p>{{foo|
84178417 </p>
8418 -<h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
 8418+<h2><span class="editsection">[<a href="https://www.mediawiki.org/wiki/Parser_test?action=edit&amp;section=1" title="Edit section: heading">edit</a>]</span> <span class="mw-headline" id="heading">heading</span></h2>
84198419
84208420 !! end
84218421
@@ -8688,7 +8688,7 @@
86898689 !! input
86908690 [[2009-03-24]]
86918691 !! result
8692 -<p><span class="mw-formatted-date" title="2009-03-24"><a href="https://www.mediawiki.org/index.php?title=2009&amp;action=edit&amp;redlink=1" class="new" title="2009 (page does not exist)">2009</a>-<a href="https://www.mediawiki.org/index.php?title=March_24&amp;action=edit&amp;redlink=1" class="new" title="March 24 (page does not exist)">03-24</a></span>
 8692+<p><span class="mw-formatted-date" title="2009-03-24"><a href="https://www.mediawiki.org/wiki/2009?action=edit&amp;redlink=1" class="new" title="2009 (page does not exist)">2009</a>-<a href="https://www.mediawiki.org/wiki/March_24?action=edit&amp;redlink=1" class="new" title="March 24 (page does not exist)">03-24</a></span>
86938693 </p>
86948694 !!end
86958695
@@ -8717,7 +8717,7 @@
87188718 !! input
87198719 [[2009-03-24]]
87208720 !! result
8721 -<p><a href="https://www.mediawiki.org/index.php?title=2009-03-24&amp;action=edit&amp;redlink=1" class="new" title="2009-03-24 (page does not exist)">2009-03-24</a>
 8721+<p><a href="https://www.mediawiki.org/wiki/2009-03-24?action=edit&amp;redlink=1" class="new" title="2009-03-24 (page does not exist)">2009-03-24</a>
87228722 </p>
87238723 !! end
87248724
@@ -8737,7 +8737,7 @@
87388738 !! input
87398739 [[January 15]]
87408740 !! result
8741 -<p><span class="mw-formatted-date" title="01-15"><a href="https://www.mediawiki.org/index.php?title=January_15&amp;action=edit&amp;redlink=1" class="new" title="January 15 (page does not exist)">January 15</a></span>
 8741+<p><span class="mw-formatted-date" title="01-15"><a href="https://www.mediawiki.org/wiki/January_15?action=edit&amp;redlink=1" class="new" title="January 15 (page does not exist)">January 15</a></span>
87428742 </p>
87438743 !! end
87448744
@@ -8831,7 +8831,7 @@
88328832 !! input
88338833 Poked at a [[/subpage]] here...
88348834 !! result
8835 -Poked at a <a href="https://www.mediawiki.org/index.php?title=/subpage&amp;action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
 8835+Poked at a <a href="https://www.mediawiki.org/wiki//subpage?action=edit&amp;redlink=1" class="new" title="/subpage (page does not exist)">/subpage</a> here...
88368836 !!end
88378837
88388838 !! test
@@ -8893,7 +8893,7 @@
88948894 !!input
88958895 [[ABC%33D% ++]] [[ABC%33D% ++|+%20]]
88968896 !! result
8897 -<a href="https://www.mediawiki.org/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="https://www.mediawiki.org/index.php?title=ABC3D%25_%2B%2B&amp;action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
 8897+<a href="https://www.mediawiki.org/wiki/ABC3D%25_%2B%2B?action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="https://www.mediawiki.org/wiki/ABC3D%25_%2B%2B?action=edit&amp;redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a>
88988898 !! end
88998899
89008900 !! test
@@ -8994,7 +8994,7 @@
89958995 !! result
89968996 Screen
89978997 <p>this is not the the title
8998 -<a href="https://www.mediawiki.org/index.php?title=Template:DISPLAYTITLE:screen&amp;action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
 8998+<a href="https://www.mediawiki.org/wiki/Template:DISPLAYTITLE:screen?action=edit&amp;redlink=1" class="new" title="Template:DISPLAYTITLE:screen (page does not exist)">Template:DISPLAYTITLE:screen</a>
89998999 </p>
90009000 !! end
90019001
@@ -9090,10 +9090,10 @@
90919091 [[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]]
90929092 [[%33%45]] [[%33%45+]]
90939093 !! result
9094 -<p><a href="https://www.mediawiki.org/index.php?title=User:%2B%25&amp;action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="https://www.mediawiki.org/index.php?title=Page%2Btitle%25&amp;action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
9095 -<a href="https://www.mediawiki.org/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="https://www.mediawiki.org/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="https://www.mediawiki.org/index.php?title=%25%2B&amp;action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="https://www.mediawiki.org/index.php?title=%25%2Br&amp;action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
9096 -<a href="https://www.mediawiki.org/index.php?title=%25&amp;action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="https://www.mediawiki.org/index.php?title=%2B&amp;action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
9097 -<a href="https://www.mediawiki.org/index.php?title=3E&amp;action=edit&amp;redlink=1" class="new" title="3E (page does not exist)">3E</a> <a href="https://www.mediawiki.org/index.php?title=3E%2B&amp;action=edit&amp;redlink=1" class="new" title="3E+ (page does not exist)">3E+</a>
 9094+<p><a href="https://www.mediawiki.org/wiki/User:%2B%25?action=edit&amp;redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="https://www.mediawiki.org/wiki/Page%2Btitle%25?action=edit&amp;redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a>
 9095+<a href="https://www.mediawiki.org/wiki/%25%2B?action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="https://www.mediawiki.org/wiki/%25%2B?action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="https://www.mediawiki.org/wiki/%25%2B?action=edit&amp;redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="https://www.mediawiki.org/wiki/%25%2Br?action=edit&amp;redlink=1" class="new" title="%+r (page does not exist)">%+r</a>
 9096+<a href="https://www.mediawiki.org/wiki/%25?action=edit&amp;redlink=1" class="new" title="% (page does not exist)">%</a> <a href="https://www.mediawiki.org/wiki/%2B?action=edit&amp;redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a>
 9097+<a href="https://www.mediawiki.org/wiki/3E?action=edit&amp;redlink=1" class="new" title="3E (page does not exist)">3E</a> <a href="https://www.mediawiki.org/wiki/3E%2B?action=edit&amp;redlink=1" class="new" title="3E+ (page does not exist)">3E+</a>
90989098 </p>
90999099 !! end
91009100
@@ -9103,8 +9103,8 @@
91049104 [[File:Contains & ampersand.jpg]]
91059105 [[File:Does not exist.jpg|Title with & ampersand]]
91069106 !! result
9107 -<p><a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
9108 -<a href="https://www.mediawiki.org/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
 9107+<p><a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains &amp; ampersand.jpg">File:Contains &amp; ampersand.jpg</a>
 9108+<a href="https://www.mediawiki.org/wiki/Special:Upload?wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
91099109 </p>
91109110 !! end
91119111
Index: trunk/phase3/includes/Setup.php
@@ -42,6 +42,12 @@
4343 }
4444 }
4545
 46+if ( !empty($wgActionPaths) && !isset($wgActionPaths['view']) ) {
 47+ # 'view' is assumed the default action path everywhere in the code
 48+ # but is rarely filled in $wgActionPaths
 49+ $wgActionPaths['view'] = $wgArticlePath ;
 50+}
 51+
4652 if ( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
4753 if ( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins";
4854 if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
Index: trunk/phase3/includes/Title.php
@@ -876,29 +876,21 @@
877877 $url = str_replace( '$1', $dbkey, $wgArticlePath );
878878 }
879879 } else {
 880+ $url = false;
 881+
880882 global $wgActionPaths;
881 - $url = false;
882 - $matches = array();
883 - if ( !empty( $wgActionPaths ) &&
884 - preg_match( '/^(.*&|)action=([^&]*)(&(.*)|)$/', $query, $matches ) )
885 - {
886 - $action = urldecode( $matches[2] );
887 - if ( isset( $wgActionPaths[$action] ) ) {
888 - $query = $matches[1];
889 - if ( isset( $matches[4] ) ) {
890 - $query .= $matches[4];
891 - }
892 - $url = str_replace( '$1', $dbkey, $wgActionPaths[$action] );
893 - if ( $query != '' ) {
894 - $url = wfAppendQuery( $url, $query );
895 - }
896 - }
 883+ if( !empty( $wgActionPaths ) ) {
 884+ $url = Title::resolveActionPath( $dbkey, $query );
897885 }
 886+
898887 if ( $url === false ) {
899888 if ( $query == '-' ) {
900889 $query = '';
901890 }
902 - $url = "{$wgScript}?title={$dbkey}&{$query}";
 891+ #$url = "{$wgScript}?title={$dbkey}&{$query}";
 892+ # forge a nice URL (ex: /wiki/Special:Foo?q=1&r=2 )
 893+ $baseurl = str_replace( '$1', $dbkey, $wgArticlePath );
 894+ $url = wfAppendQuery( $baseurl, $query );
903895 }
904896 }
905897
@@ -913,6 +905,38 @@
914906 }
915907
916908 /**
 909+ * Helper for getLocalUrl() to handles $wgActionPaths
 910+ *
 911+ * @param $dbkey string Title in database key format
 912+ * @param $query string request parameters in CGI format (p=1&q=2&..)
 913+ * @return Url resolved or boolean false
 914+ */
 915+ private static function resolveActionPath( $dbkey, $query ) {
 916+ $url = '';
 917+
 918+ # query parameters are easier to handle using an array:
 919+ $queryArray = wfCGIToArray( $query );
 920+
 921+ global $wgActionPaths;
 922+ if( !array_key_exists( 'action', $queryArray ) ) {
 923+ // Makes the default action 'view' and points to $wgArticlePath
 924+ // FIXME: this should be handled in Setup or Wiki!
 925+ global $wgArticlePath;
 926+ $url = str_replace( '$1', $dbkey, $wgArticlePath );
 927+ } elseif( isset( $wgActionPaths[$queryArray['action']] ) ) {
 928+ $url = str_replace( '$1', $dbkey, $wgActionPaths[$queryArray['action']] );
 929+ } else {
 930+ # No path found
 931+ return false;
 932+ }
 933+
 934+ # No need to append the action since we have embed it in the path
 935+ unset( $queryArray['action'] );
 936+ $url = wfAppendQuery( $url, wfArrayToCGI( $queryArray ) );
 937+ return $url;
 938+ }
 939+
 940+ /**
917941 * Get a URL that's the simplest URL that will be valid to link, locally,
918942 * to the current Title. It includes the fragment, but does not include
919943 * the server unless action=render is used (or the link is external). If
Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js
@@ -65,8 +65,8 @@
6666 var link = this;
6767 $link
6868 .data( 'icon', $link.closest( 'li' ).hasClass( 'icon' ) )
69 - .data( 'action', mw.util.getParamValue( 'action', link.href ) == 'unwatch' ? 'unwatch' : 'watch' );
70 - var title = mw.util.getParamValue( 'title', link.href );
 69+ .data( 'action', mw.util.getActionFrom( link.href ) == 'unwatch' ? 'unwatch' : 'watch' );
 70+ var title = mw.util.getTitleFrom( link.href );
7171 $link.data( 'target', title.replace( /_/g, ' ' ) );
7272 });
7373
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.js
@@ -207,6 +207,12 @@
208208 /**
209209 * Grab the URL parameter value for the given parameter.
210210 * Returns null if not found.
 211+ * Beware! When action paths are enabled (wgActionPaths) using this function
 212+ * to retrieve the 'action' or 'title' parameter will probably fail since
 213+ * those parameters are hidden in the path.
 214+ * To safely query for:
 215+ * 'action' use getActionFrom( url )
 216+ * 'title' use getTitleFrom( url )
211217 *
212218 * @param param The parameter name
213219 * @param url URL to search through (optional)
@@ -222,6 +228,63 @@
223229 return null;
224230 },
225231
 232+ /**
 233+ * Try to find the wiki action for a given URL with actions paths support
 234+ *
 235+ * @param url URL to search for a wiki action
 236+ */
 237+ 'getActionFrom' : function( url ) {
 238+ // attempt to get the action from the parameter [&?]action=
 239+ var action = mw.util.getParamValue( 'action', url );
 240+ if( action !== null ) {
 241+ return action;
 242+ }
 243+
 244+ // now from the action paths
 245+ var actionPaths = mw.config.get( 'wgActionPaths' );
 246+ if( actionPaths.length == 0 ) {
 247+ actionPaths['view'] = mw.config.get( 'wgArticlePath' );
 248+ }
 249+ var action = '';
 250+ for ( action in actionPaths ) {
 251+ var actionRe = new RegExp( actionPaths[action].replace( '$1', '.*?' ) );
 252+ if( url.match( actionRe ) ) {
 253+ return action;
 254+ }
 255+ }
 256+
 257+ return null;
 258+ },
 259+
 260+ /**
 261+ * Try to find the wiki title for a given URL with actions paths support
 262+ *
 263+ * @param url URL to search for a title
 264+ */
 265+ 'getTitleFrom' : function( url ) {
 266+ // attempt to get the title from the parameter [&?]title=
 267+ var title = mw.util.getParamValue( 'title', url );
 268+ if( title !== null ) {
 269+ return title;
 270+ }
 271+
 272+ // now from the action paths
 273+ var actionPaths = mw.config.get( 'wgActionPaths' );
 274+ if( actionPaths.length == 0 ) {
 275+ actionPaths['view'] = mw.config.get( 'wgArticlePath' );
 276+ }
 277+ var action = '';
 278+ for ( action in actionPaths ) {
 279+ var actionRe = new RegExp( '.*' + actionPaths[action].replace( '$1', '([^&?#]+)' ) );
 280+ var title = url.match( actionRe );
 281+ if( title !== null ) {
 282+ return title[1];
 283+ }
 284+ }
 285+
 286+ return null;
 287+ },
 288+
226289 // Access key prefix.
227290 // Will be re-defined based on browser/operating system detection in
228291 // mw.util.init().
@@ -548,4 +611,4 @@
549612
550613 mw.util.init();
551614
552 -} )( jQuery, mediaWiki );
\ No newline at end of file
 615+} )( jQuery, mediaWiki );

Follow-up revisions

RevisionCommit summaryAuthorDate
r88276mw.util.getActionFrom incorrectly returns null...krinkle22:51, 16 May 2011
r88667Revert r87964: destroyed standard segregation of non-view action links outsid...brion19:03, 23 May 2011
r88679Follow-up to r88667; finish reverting bogus test cases from r87964. It looks ...brion20:24, 23 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r2621* Fixed magic quotes in $_REQUEST, in Setup.php...timstarling01:49, 6 March 2004
r84386Makes wikilinks nicer when possible...hashar14:57, 20 March 2011
r84491Fix javascript watch/unwatch with pretty URL...hashar21:50, 21 March 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   18:53, 23 May 2011

It looks like this destroys the ability to use robots.txt to block all the action paths, which will result in lots of extra bogus URLs in search engines and extra search spider traffic. Needs to be reverted.

#Comment by Brion VIBBER (talk | contribs)   19:03, 23 May 2011

Reverted in r88667.

#Comment by Brion VIBBER (talk | contribs)   20:12, 23 May 2011

This also caused action=raw to fail for legacy-style site/user JS/CSS loading etc, since for security reasons action=raw enforces that you MUST NOT use pathinfo-style appended paths. There was a bugzilla entry for this (now resolved fixed since the revert).

Status & tagging log