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 "Update docs in CdbPHP.php"
[lhc/web/wiklou.git]
/
includes
/
parser
/
Tidy.php
diff --git
a/includes/parser/Tidy.php
b/includes/parser/Tidy.php
index
e3ea40b
..
32b16aa
100644
(file)
--- a/
includes/parser/Tidy.php
+++ b/
includes/parser/Tidy.php
@@
-61,7
+61,10
@@
class MWTidyWrapper {
// Replace <mw:editsection> elements with placeholders
$wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
// Replace <mw:editsection> elements with placeholders
$wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
- array( &$this, 'replaceEditSectionLinksCallback' ), $text );
+ array( &$this, 'replaceCallback' ), $text );
+ // ...and <mw:toc> markers
+ $wrappedtext = preg_replace_callback( '/\<\\/?mw:toc\>/',
+ array( &$this, 'replaceCallback' ), $wrappedtext );
// Modify inline Microdata <link> and <meta> elements so they say <html-link> and <html-meta> so
// we can trick Tidy into not stripping them out by including them in tidy's new-empty-tags config
// Modify inline Microdata <link> and <meta> elements so they say <html-link> and <html-meta> so
// we can trick Tidy into not stripping them out by including them in tidy's new-empty-tags config
@@
-80,7
+83,7
@@
class MWTidyWrapper {
*
* @return string
*/
*
* @return string
*/
- function replace
EditSectionLinks
Callback( $m ) {
+ function replaceCallback( $m ) {
$marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
$this->mMarkerIndex++;
$this->mTokens->setPair( $marker, $m[0] );
$marker = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
$this->mMarkerIndex++;
$this->mTokens->setPair( $marker, $m[0] );
@@
-244,7
+247,7
@@
class MWTidy {
global $wgTidyConf, $wgDebugTidy;
wfProfileIn( __METHOD__ );
global $wgTidyConf, $wgDebugTidy;
wfProfileIn( __METHOD__ );
- if ( !
MWInit::classE
xists( 'tidy' ) ) {
+ if ( !
class_e
xists( 'tidy' ) ) {
wfWarn( "Unable to load internal tidy class." );
$retval = -1;
wfWarn( "Unable to load internal tidy class." );
$retval = -1;