dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Create mediawiki.widgets and mw.widgets.TitleInputWidget in it"
[lhc/web/wiklou.git]
/
includes
/
Linker.php
diff --git
a/includes/Linker.php
b/includes/Linker.php
index
dd224ef
..
4a1aa87
100644
(file)
--- a/
includes/Linker.php
+++ b/
includes/Linker.php
@@
-1388,7
+1388,9
@@
class Linker {
*
* @return string
*/
*
* @return string
*/
- public static function formatLinksInComment( $comment, $title = null, $local = false, $wikiId = null ) {
+ public static function formatLinksInComment(
+ $comment, $title = null, $local = false, $wikiId = null
+ ) {
return preg_replace_callback(
'/
\[\[
return preg_replace_callback(
'/
\[\[
@@
-1707,9
+1709,10
@@
class Linker {
* Currently unused.
*
* @param array $tree Return value of ParserOutput::getSections()
* Currently unused.
*
* @param array $tree Return value of ParserOutput::getSections()
+ * @param string|Language|bool $lang Language for the toc title, defaults to user language
* @return string HTML fragment
*/
* @return string HTML fragment
*/
- public static function generateTOC( $tree ) {
+ public static function generateTOC( $tree
, $lang = false
) {
$toc = '';
$lastLevel = 0;
foreach ( $tree as $section ) {
$toc = '';
$lastLevel = 0;
foreach ( $tree as $section ) {
@@
-1728,7
+1731,7
@@
class Linker {
$lastLevel = $section['toclevel'];
}
$toc .= self::tocLineEnd();
$lastLevel = $section['toclevel'];
}
$toc .= self::tocLineEnd();
- return self::tocList( $toc );
+ return self::tocList( $toc
, $lang
);
}
/**
}
/**
@@
-1750,14
+1753,6
@@
class Linker {
$link, $legacyAnchor = false
) {
$ret = "<h$level$attribs"
$link, $legacyAnchor = false
) {
$ret = "<h$level$attribs"
- . Html::element( 'a',
- array(
- 'href' => '#' . $anchor,
- 'class' => 'mw-headline-anchor',
- 'title' => wfMessage( 'headline-anchor-title' )->text()
- ),
- wfMessage( 'section-symbol' )->text()
- )
. "<span class=\"mw-headline\" id=\"$anchor\">$html</span>"
. $link
. "</h$level>";
. "<span class=\"mw-headline\" id=\"$anchor\">$html</span>"
. $link
. "</h$level>";