Make "→" link to page section on History page larger by adding section name to it
Bug: T165189 Change-Id: I1f845592bd3de342fda84b60fc412055973950fd
This commit is contained in:
parent
e19f8e4d04
commit
0a8e16d7cf
3 changed files with 26 additions and 22 deletions
|
|
@ -1168,7 +1168,10 @@ class Linker {
|
||||||
$title->getDBkey(), $section );
|
$title->getDBkey(), $section );
|
||||||
}
|
}
|
||||||
if ( $sectionTitle ) {
|
if ( $sectionTitle ) {
|
||||||
$link = Linker::makeCommentLink( $sectionTitle, $wgLang->getArrow(), $wikiId, 'noclasses' );
|
$link = Linker::makeCommentLink(
|
||||||
|
$sectionTitle, $wgLang->getArrow() . $auto, $wikiId, 'noclasses'
|
||||||
|
);
|
||||||
|
$auto = '';
|
||||||
} else {
|
} else {
|
||||||
$link = '';
|
$link = '';
|
||||||
}
|
}
|
||||||
|
|
@ -1181,11 +1184,12 @@ class Linker {
|
||||||
# autocomment $postsep written summary (/* section */ summary)
|
# autocomment $postsep written summary (/* section */ summary)
|
||||||
$auto .= wfMessage( 'colon-separator' )->inContentLanguage()->escaped();
|
$auto .= wfMessage( 'colon-separator' )->inContentLanguage()->escaped();
|
||||||
}
|
}
|
||||||
$auto = '<span class="autocomment">' . $auto . '</span>';
|
if ( $auto ) {
|
||||||
$comment = $pre . $link . $wgLang->getDirMark()
|
$auto = '<span dir="auto"><span class="autocomment">' . $auto . '</span>';
|
||||||
. '<span dir="auto">' . $auto;
|
|
||||||
$append .= '</span>';
|
$append .= '</span>';
|
||||||
}
|
}
|
||||||
|
$comment = $pre . $link . $wgLang->getDirMark() . $auto;
|
||||||
|
}
|
||||||
return $comment;
|
return $comment;
|
||||||
},
|
},
|
||||||
$comment
|
$comment
|
||||||
|
|
|
||||||
|
|
@ -24422,7 +24422,7 @@ comment title=[[Main Page]]
|
||||||
!! wikitext
|
!! wikitext
|
||||||
/* External links */ removed bogus entries
|
/* External links */ removed bogus entries
|
||||||
!! html/php
|
!! html/php
|
||||||
<a href="/wiki/Main_Page#External_links" title="Main Page">→</a><span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
|
<a href="/wiki/Main_Page#External_links" title="Main Page">→External links</a><span dir="auto"><span class="autocomment">: </span> removed bogus entries</span>
|
||||||
!!end
|
!!end
|
||||||
|
|
||||||
!! test
|
!! test
|
||||||
|
|
@ -24432,7 +24432,7 @@ comment title=[[Main Page]]
|
||||||
!! wikitext
|
!! wikitext
|
||||||
pre-comment text /* External links */ removed bogus entries
|
pre-comment text /* External links */ removed bogus entries
|
||||||
!! html/php
|
!! html/php
|
||||||
pre-comment text <a href="/wiki/Main_Page#External_links" title="Main Page">→</a><span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
|
pre-comment text <a href="/wiki/Main_Page#External_links" title="Main Page">→External links</a><span dir="auto"><span class="autocomment">: </span> removed bogus entries</span>
|
||||||
!!end
|
!!end
|
||||||
|
|
||||||
!! test
|
!! test
|
||||||
|
|
@ -24442,7 +24442,7 @@ comment local title=[[Main Page]]
|
||||||
!! wikitext
|
!! wikitext
|
||||||
/* External links */ removed bogus entries
|
/* External links */ removed bogus entries
|
||||||
!! html/php
|
!! html/php
|
||||||
<a href="#External_links">→</a><span dir="auto"><span class="autocomment">External links: </span> removed bogus entries</span>
|
<a href="#External_links">→External links</a><span dir="auto"><span class="autocomment">: </span> removed bogus entries</span>
|
||||||
!!end
|
!!end
|
||||||
|
|
||||||
!! test
|
!! test
|
||||||
|
|
@ -24553,7 +24553,7 @@ title=[[Main Page]]
|
||||||
!! wikitext
|
!! wikitext
|
||||||
/* __hello__world__ */
|
/* __hello__world__ */
|
||||||
!! html/php
|
!! html/php
|
||||||
<a href="/wiki/Main_Page#hello_world" title="Main Page">→</a><span dir="auto"><span class="autocomment">__hello__world__</span></span>
|
<a href="/wiki/Main_Page#hello_world" title="Main Page">→__hello__world__</a>
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
!! test
|
!! test
|
||||||
|
|
|
||||||
|
|
@ -152,43 +152,43 @@ class LinkerTest extends MediaWikiLangTestCase {
|
||||||
],
|
],
|
||||||
// Linker::formatAutocomments
|
// Linker::formatAutocomments
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
|
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>',
|
||||||
"/* autocomment */",
|
"/* autocomment */",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#linkie.3F" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment"><a href="/wiki/index.php?title=Linkie%3F&action=edit&redlink=1" class="new" title="Linkie? (page does not exist)">linkie?</a></span></span>',
|
'<a href="/wiki/Special:BlankPage#linkie.3F" title="Special:BlankPage">→<a href="/wiki/index.php?title=Linkie%3F&action=edit&redlink=1" class="new" title="Linkie? (page does not exist)">linkie?</a></a>',
|
||||||
"/* [[linkie?]] */",
|
"/* [[linkie?]] */",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment: </span> post</span>',
|
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a><span dir="auto"><span class="autocomment">: </span> post</span>',
|
||||||
"/* autocomment */ post",
|
"/* autocomment */ post",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
|
'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>',
|
||||||
"pre /* autocomment */",
|
"pre /* autocomment */",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment: </span> post</span>',
|
'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a><span dir="auto"><span class="autocomment">: </span> post</span>',
|
||||||
"pre /* autocomment */ post",
|
"pre /* autocomment */ post",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment: </span> multiple? <a href="/wiki/Special:BlankPage#autocomment2" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment2: </span> </span></span>',
|
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a><span dir="auto"><span class="autocomment">: </span> multiple? <a href="/wiki/Special:BlankPage#autocomment2" title="Special:BlankPage">→autocomment2</a></span>',
|
||||||
"/* autocomment */ multiple? /* autocomment2 */",
|
"/* autocomment */ multiple? /* autocomment2 */",
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment_containing_.2F.2A" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment containing /*: </span> T70361</span>',
|
'<a href="/wiki/Special:BlankPage#autocomment_containing_.2F.2A" title="Special:BlankPage">→autocomment containing /*</a><span dir="auto"><span class="autocomment">: </span> T70361</span>',
|
||||||
"/* autocomment containing /* */ T70361"
|
"/* autocomment containing /* */ T70361"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment_containing_.22quotes.22" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment containing "quotes"</span></span>',
|
'<a href="/wiki/Special:BlankPage#autocomment_containing_.22quotes.22" title="Special:BlankPage">→autocomment containing "quotes"</a>',
|
||||||
"/* autocomment containing \"quotes\" */"
|
"/* autocomment containing \"quotes\" */"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment_containing_.3Cscript.3Etags.3C.2Fscript.3E" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment containing <script>tags</script></span></span>',
|
'<a href="/wiki/Special:BlankPage#autocomment_containing_.3Cscript.3Etags.3C.2Fscript.3E" title="Special:BlankPage">→autocomment containing <script>tags</script></a>',
|
||||||
"/* autocomment containing <script>tags</script> */"
|
"/* autocomment containing <script>tags</script> */"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="#autocomment">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
|
'<a href="#autocomment">→autocomment</a>',
|
||||||
"/* autocomment */",
|
"/* autocomment */",
|
||||||
false, true
|
false, true
|
||||||
],
|
],
|
||||||
|
|
@ -198,12 +198,12 @@ class LinkerTest extends MediaWikiLangTestCase {
|
||||||
null
|
null
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
|
'<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>',
|
||||||
"/* autocomment */",
|
"/* autocomment */",
|
||||||
false, false
|
false, false
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'<a class="external" rel="nofollow" href="//en.example.org/w/Special:BlankPage#autocomment">→</a><span dir="auto"><span class="autocomment">autocomment</span></span>',
|
'<a class="external" rel="nofollow" href="//en.example.org/w/Special:BlankPage#autocomment">→autocomment</a>',
|
||||||
"/* autocomment */",
|
"/* autocomment */",
|
||||||
false, false, $wikiId
|
false, false, $wikiId
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue