A follow-up to
0a8e16d7cfe6c thanks to Anomie's code review.
The section title is now inside <span dir="auto"> and <span
class="autocomment">, as before. $wgLang->getDirMark() between the arrow
and the text was restored.
Given the comment
/* External links */ removed bogus entries
the HTML before
0a8e16d7cfe6c looked like:
<a href="#External_links">→</a><span dir="auto"><span
class="autocomment">External links: </span> removed bogus entries</span>
after this change, it will look like:
<span dir="auto"><span class="autocomment"><a
href="#External_links">→External links</a>: </span> removed bogus
entries</span>
The issue of having links be inside other links will be addressed in a
separate patch.
Bug: T165189
Change-Id: I31d87a87ccaf50de58fdd0621c46133b2881b490
);
if ( $comment === null ) {
);
if ( $comment === null ) {
if ( $title ) {
$section = $auto;
# Remove links that a user may have manually put in the autosummary
if ( $title ) {
$section = $auto;
# Remove links that a user may have manually put in the autosummary
$title->getDBkey(), $section );
}
if ( $sectionTitle ) {
$title->getDBkey(), $section );
}
if ( $sectionTitle ) {
- $link = Linker::makeCommentLink(
- $sectionTitle, $wgLang->getArrow() . $auto, $wikiId, 'noclasses'
+ $auto = Linker::makeCommentLink(
+ $sectionTitle, $wgLang->getArrow() . $wgLang->getDirMark() . $auto,
+ $wikiId, 'noclasses'
- $auto = '';
- } else {
- $link = '';
$auto = '<span dir="auto"><span class="autocomment">' . $auto . '</span>';
$append .= '</span>';
}
$auto = '<span dir="auto"><span class="autocomment">' . $auto . '</span>';
$append .= '</span>';
}
- $comment = $pre . $link . $wgLang->getDirMark() . $auto;
+ $comment = $pre . $auto;
!! wikitext
/* External links */ removed bogus entries
!! html/php
!! wikitext
/* External links */ removed bogus entries
!! html/php
-<a href="/wiki/Main_Page#External_links" title="Main Page">→External links</a><span dir="auto"><span class="autocomment">: </span> removed bogus entries</span>
+<span dir="auto"><span class="autocomment"><a href="/wiki/Main_Page#External_links" title="Main Page">→External links</a>: </span> removed bogus entries</span>
!! wikitext
pre-comment text /* External links */ removed bogus entries
!! html/php
!! wikitext
pre-comment text /* External links */ removed bogus entries
!! html/php
-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>
+pre-comment text <span dir="auto"><span class="autocomment"><a href="/wiki/Main_Page#External_links" title="Main Page">→External links</a>: </span> removed bogus entries</span>
!! wikitext
/* External links */ removed bogus entries
!! html/php
!! wikitext
/* External links */ removed bogus entries
!! html/php
-<a href="#External_links">→External links</a><span dir="auto"><span class="autocomment">: </span> removed bogus entries</span>
+<span dir="auto"><span class="autocomment"><a href="#External_links">→External links</a>: </span> removed bogus entries</span>
!! wikitext
/* __hello__world__ */
!! html/php
!! wikitext
/* __hello__world__ */
!! html/php
-<a href="/wiki/Main_Page#hello_world" title="Main Page">→__hello__world__</a>
+<span dir="auto"><span class="autocomment"><a href="/wiki/Main_Page#hello_world" title="Main Page">→__hello__world__</a></span></span>
],
// Linker::formatAutocomments
[
],
// Linker::formatAutocomments
[
- '<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a></span></span>',
"/* autocomment */",
],
[
"/* autocomment */",
],
[
- '<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>',
+ '<span dir="auto"><span class="autocomment"><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></span></span>',
"/* [[linkie?]] */",
],
[
"/* [[linkie?]] */",
],
[
- '<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a><span dir="auto"><span class="autocomment">: </span> post</span>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>: </span> post</span>',
"/* autocomment */ post",
],
[
"/* autocomment */ post",
],
[
- 'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>',
+ 'pre <span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a></span></span>',
"pre /* autocomment */",
],
[
"pre /* autocomment */",
],
[
- 'pre <a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a><span dir="auto"><span class="autocomment">: </span> post</span>',
+ 'pre <span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>: </span> post</span>',
"pre /* autocomment */ post",
],
[
"pre /* autocomment */ post",
],
[
- '<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>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>: </span> multiple? <span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment2" title="Special:BlankPage">→autocomment2</a></span></span></span>',
"/* autocomment */ multiple? /* autocomment2 */",
],
[
"/* autocomment */ multiple? /* autocomment2 */",
],
[
- '<a href="/wiki/Special:BlankPage#autocomment_containing_.2F.2A" title="Special:BlankPage">→autocomment containing /*</a><span dir="auto"><span class="autocomment">: </span> T70361</span>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment_containing_.2F.2A" title="Special:BlankPage">→autocomment containing /*</a>: </span> T70361</span>',
"/* autocomment containing /* */ T70361"
],
[
"/* autocomment containing /* */ T70361"
],
[
- '<a href="/wiki/Special:BlankPage#autocomment_containing_.22quotes.22" title="Special:BlankPage">→autocomment containing "quotes"</a>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment_containing_.22quotes.22" title="Special:BlankPage">→autocomment containing "quotes"</a></span></span>',
"/* autocomment containing \"quotes\" */"
],
[
"/* autocomment containing \"quotes\" */"
],
[
- '<a href="/wiki/Special:BlankPage#autocomment_containing_.3Cscript.3Etags.3C.2Fscript.3E" title="Special:BlankPage">→autocomment containing <script>tags</script></a>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment_containing_.3Cscript.3Etags.3C.2Fscript.3E" title="Special:BlankPage">→autocomment containing <script>tags</script></a></span></span>',
"/* autocomment containing <script>tags</script> */"
],
[
"/* autocomment containing <script>tags</script> */"
],
[
- '<a href="#autocomment">→autocomment</a>',
+ '<span dir="auto"><span class="autocomment"><a href="#autocomment">→autocomment</a></span></span>',
"/* autocomment */",
false, true
],
[
"/* autocomment */",
false, true
],
[
- '<span dir="auto"><span class="autocomment">autocomment</span></span>',
+ '<span dir="auto"><span class="autocomment">autocomment</span></span>',
"/* autocomment */",
null
],
[
"/* autocomment */",
null
],
[
- '<a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a>',
+ '<span dir="auto"><span class="autocomment"><a href="/wiki/Special:BlankPage#autocomment" title="Special:BlankPage">→autocomment</a></span></span>',
"/* autocomment */",
false, false
],
[
"/* autocomment */",
false, false
],
[
- '<a class="external" rel="nofollow" href="//en.example.org/w/Special:BlankPage#autocomment">→autocomment</a>',
+ '<span dir="auto"><span class="autocomment"><a class="external" rel="nofollow" href="//en.example.org/w/Special:BlankPage#autocomment">→autocomment</a></span></span>',
"/* autocomment */",
false, false, $wikiId
],
"/* autocomment */",
false, false, $wikiId
],