'/(.) (?=\\?|:|;|!|\\302\\273)/' => '\\1 \\2',
# french spaces, Guillemet-right
'/(\\302\\253) /' => '\\1 ',
- '/<hr *>/i' => '<hr />',
- '/<br *>/i' => '<br />',
'/<center *>/i' => '<div class="center">',
'/<\\/center *>/i' => '</div>',
);
$params = array( );
}
+ // Hack to support short XML style tags
+ $text = preg_replace( "/<$tag(\\s+[^>]*|\\s*)\\/>/i", "<$tag\\1></$tag>", $text );
+
if( $tag == STRIP_COMMENTS ) {
$start = '/<!--()/';
$end = '/-->/';
} else {
- $start = "/<$tag([^>]*)>/i";
+ $start = "/<$tag(\\s+[^>]*|\\s*)>/i";
$end = "/<\\/$tag\\s*>/i";
}
$s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail );
continue;
}
- if ( $nt->isAlwaysKnown() ) {
+ if( $nt->isLocal() && $nt->isAlwaysKnown() ) {
+ /**
+ * Skip lookups for special pages and self-links.
+ * External interwiki links are not included here because
+ * the HTTP urls would break output in the next parse step;
+ * they will have placeholders kept.
+ */
$s .= $sk->makeKnownLinkObj( $nt, $text, '', $trail, $prefix );
} else {
/**
$mwMsgnw =& MagicWord::get( MAG_MSGNW );
if ( $mwMsgnw->matchStartAndRemove( $part1 ) ) {
$nowiki = true;
+ } else {
+ # Remove obsolete MSG:
+ $mwMsg =& MagicWord::get( MAG_MSG );
+ $mwMsg->matchStartAndRemove( $part1 );
}
- # int: is the wikitext equivalent of wfMsg()
+ # Check if it is an internal message
$mwInt =& MagicWord::get( MAG_INT );
if ( $mwInt->matchStartAndRemove( $part1 ) ) {
if ( $this->incrementIncludeCount( 'int:'.$part1 ) ) {
$found = true;
}
}
-
- # msg: is the wikitext equivalent of wfMsgForContent()
- $mwMsg =& MagicWord::get( MAG_MSG );
- if ( $mwMsg->matchStartAndRemove( $part1 ) ) {
- if ( $this->incrementIncludeCount( 'msg:'.$part1 ) ) {
- $text = $linestart . wfMsgReal( $part1, $args, true, true );
- $found = true;
- }
- }
}
# NS
*/
function renderImageGallery( $text ) {
# Setup the parser
- global $wgUser, $wgParser, $wgTitle;
+ global $wgUser, $wgTitle;
$parserOptions = ParserOptions::newFromUser( $wgUser );
-
+ $localParser = new Parser();
+
global $wgLinkCache;
$ig = new ImageGallery();
$ig->setShowBytes( false );
$label = '';
}
- $html = $wgParser->parse( $label , $wgTitle, $parserOptions );
+ $html = $localParser->parse( $label , $wgTitle, $parserOptions );
$html = $html->mText;
$ig->add( new Image( $nt ), $html );