From: jenkins-bot Date: Thu, 31 Aug 2017 21:02:12 +0000 (+0000) Subject: Merge "Move section ID fallbacks into headers themselves" X-Git-Tag: 1.31.0-rc.0~2245 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=802c199d0bd80ff0f4d730c61fd58cbf08a52d8d;hp=-c Merge "Move section ID fallbacks into headers themselves" --- 802c199d0bd80ff0f4d730c61fd58cbf08a52d8d diff --combined includes/Linker.php index d55f0e0bb5,33e30c9b24..aedb704a8f --- a/includes/Linker.php +++ b/includes/Linker.php @@@ -154,11 -154,6 +154,11 @@@ class Linker * @since 1.16.3 * @deprecated since 1.28, use MediaWiki\Linker\LinkRenderer instead * @see Linker::link + * @param Title $target + * @param string $html + * @param array $customAttribs + * @param array $query + * @param string|array $options * @return string */ public static function linkKnown( @@@ -1355,7 -1350,7 +1355,7 @@@ /** * @param Title $contextTitle * @param string $target - * @param string $text + * @param string &$text * @return string */ public static function normalizeSubpageLink( $contextTitle, $target, &$text ) { @@@ -1624,14 -1619,16 +1624,16 @@@ $link, $fallbackAnchor = false ) { $anchorEscaped = htmlspecialchars( $anchor ); - $ret = "$html" - . $link - . ""; + $fallback = ''; if ( $fallbackAnchor !== false && $fallbackAnchor !== $anchor ) { $fallbackAnchor = htmlspecialchars( $fallbackAnchor ); - $ret = "
$ret"; + $fallback = ""; } + $ret = "$html" + . $link + . ""; + return $ret; } diff --combined tests/parser/parserTests.txt index 2fa3cb05d0,82d195a653..02051658ae --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@@ -15807,26 -15807,6 +15807,26 @@@ parsoid=wt2htm !! end +!! test +9. Categories and newlines: should behave properly with linkprefix (T87753) +!! options +language=ar +!! wikitext +foo bar +foo bar +[[تصنيف:Foo]] +[[تصنيف:Bar]] +!! html/php +

foo bar +foo bar +

+!! html/parsoid +

foo bar +foo bar

+ + +!! end + !! test Category links with multiple namespaces !! wikitext @@@ -15874,20 -15854,6 +15874,20 @@@ x[[Category:Foo]]

xy

!! end +!! test +Link prefix/suffixes aren't applied to language links +!! options +parsoid=wt2html +language=is +!! wikitext +x[[es:Foo]]y +!! html/php +

xy +

+!! html/parsoid +

xy

+!! end + !! test Parsoid: Serialize link to file page with colon escape !! options @@@ -28458,10 -28424,10 +28458,10 @@@ wgFragmentMode=[ 'html5', 'legacy'

Foo bar[edit]

foo Bar[edit]

-

Тест[edit]

-

Тест[edit]

-

тест[edit]

-

Hey < # " > % : '[edit]

+

Тест[edit]

+

Тест[edit]

+

тест[edit]

+

Hey < # " > % : '[edit]

#Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

%F0%9F%92%A9

#啤酒 #啤酒 @@@ -28505,10 -28471,10 +28505,10 @@@ wgFragmentMode=[ 'legacy', 'html5'

Foo bar[edit]

foo Bar[edit]

-

Тест[edit]

-

Тест[edit]

-

тест[edit]

-

Hey < # " > % : '[edit]

+

Тест[edit]

+

Тест[edit]

+

тест[edit]

+

Hey < # " > % : '[edit]

#Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

.F0.9F.92.A9

#啤酒 #啤酒