'/ (\\?|:|!|\\302\\273)/i' => ' \\1',
# french spaces, Guillemet-right
'/(\\302\\253) /i' => '\\1 ',
+ '/([^> ]+(0(1|3|9);)[^< ]*)/i' => '<span class="diacrit">\\1</span>',
'/<center *>/i' => '<div class="center">',
'/<\\/center *>/i' => '</div>'
);
$doNumberHeadings = $this->mOptions->getNumberHeadings();
$doShowToc = $this->mOptions->getShowToc();
+ $forceTocHere = false;
if( !$this->mTitle->userCanEdit() ) {
$showEditLink = 0;
$rightClickHack = 0;
$doShowToc = 0;
}
- # if the string __FORCETOC__ (not case-sensitive) occurs in the HTML,
- # override above conditions and always show TOC
- $mw =& MagicWord::get( MAG_FORCETOC );
- if ($mw->matchAndRemove( $text ) ) {
+ # if the string __TOC__ (not case-sensitive) occurs in the HTML,
+ # override above conditions and always show TOC at that place
+ $mw =& MagicWord::get( MAG_TOC );
+ if ($mw->match( $text ) ) {
$doShowToc = 1;
+ $forceTocHere = true;
+ } else {
+ # if the string __FORCETOC__ (not case-sensitive) occurs in the HTML,
+ # override above conditions and always show TOC above first header
+ $mw =& MagicWord::get( MAG_FORCETOC );
+ if ($mw->matchAndRemove( $text ) ) {
+ $doShowToc = 1;
+ }
}
+
# We need this to perform operations on the HTML
# $full .= $sk->editSectionLink(0);
}
$full .= $block;
- if( $doShowToc && !$i && $isMain) {
+ if( $doShowToc && !$i && $isMain && !$forceTocHere) {
# Top anchor now in skin
$full = $full.$toc;
}
}
$i++;
}
-
- return $full;
+ if($forceTocHere) {
+ $mw =& MagicWord::get( MAG_TOC );
+ return $mw->replace( $toc, $full );
+ } else {
+ return $full;
+ }
}
# Return an HTML link for the "ISBN 123456" text
MAG_REDIRECT => array( 0, '#redirect' ),
MAG_NOTOC => array( 0, '__NOTOC__' ),
MAG_FORCETOC => array( 0, '__FORCETOC__' ),
+ MAG_TOC => array( 0, '__TOC__' ),
MAG_NOEDITSECTION => array( 0, '__NOEDITSECTION__' ),
MAG_START => array( 0, '__START__' ),
MAG_CURRENTMONTH => array( 1, 'CURRENTMONTH' ),
'oldpassword' => 'Old password',
'newpassword' => 'New password',
'retypenew' => 'Retype new password',
-'textboxsize' => 'Textbox dimensions',
+'textboxsize' => 'Editing',
'rows' => 'Rows',
'columns' => 'Columns',
'searchresultshead' => 'Search result settings',