$text = $this->internalParse( $text );
- $dashReplace = array(
- '/ - /' => " – ", # N dash
- '/(?<=[0-9])-(?=[0-9])/' => "–", # N dash between numbers
- '/ -- /' => " — " # M dash
- );
- $text = preg_replace( array_keys($dashReplace), array_values($dashReplace), $text );
-
$text = $this->unstrip( $text, $this->mStripState );
$this->replaceLinkHolders( $text );
+ $dashReplace = array(
+ '/ - /' => " – ", # N dash
+ '/(?<=[\d])-(?=[\d])/' => "–", # N dash between numbers
+ '/ -- /' => " — " # M dash
+ );
+ $text = preg_replace( array_keys($dashReplace), array_values($dashReplace), $text );
+
# the position of the convert() call should not be changed. it
# assumes that the links are all replaces and the only thing left
# is the <nowiki> mark.
* @access private
*/
function replaceExternalLinks( $text ) {
+ global $wgContLang;
$fname = 'Parser::replaceExternalLinks';
wfProfileIn( $fname );
# [[Image:Foo.jpg|[http://example.com desc]]] <- having three ] in a row fucks up,
# the real problem is with the $e1 regex
# See bug 1300.
- if (preg_match( "/^\](.*)/s", $m[3], $n ) ) {
+ #
+ # Still some problems for cases where the ] is meant to be outside punctuation,
+ # and no image is in sight. See bug 2095.
+ #
+ if( $text !== '' && preg_match( "/^\](.*)/s", $m[3], $n ) ) {
$text .= ']'; # so that replaceExternalLinks($text) works later
$m[3] = $n[1];
}
if ( $ns == NS_CATEGORY ) {
wfProfileIn( "$fname-category" );
- $t = $nt->getText();
+ $t = $wgContLang->convert($nt->getText());
$s = rtrim($s . "\n"); # bug 87
$wgLinkCache->suspend(); # Don't save in links/brokenlinks
} else {
$sortkey = $text;
}
+ $sortkey = $wgContLang->convertCategoryKey( $sortkey );
$wgLinkCache->addCategoryLinkObj( $nt, $sortkey );
$this->mOutput->addCategoryLink( $t );
$mwMsgnw =& MagicWord::get( MAG_MSGNW );
if ( $mwMsgnw->matchStartAndRemove( $part1 ) ) {
$nowiki = true;
- } else {
- # Remove obsolete MSG:
- $mwMsg =& MagicWord::get( MAG_MSG );
- $mwMsg->matchStartAndRemove( $part1 );
}
- # Check if it is an internal message
+ # int: is the wikitext equivalent of wfMsg()
$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
# remember to set an alignment, don't render immediately
$align = 'none';
} elseif ( $wgUseImageResize && ! is_null( $match = $mwWidth->matchVariableStartToEnd($val) ) ) {
+ wfDebug( "MAG_IMG_WIDTH match: $match\n" );
# $match is the image width in pixels
if ( preg_match( '/^([0-9]*)x([0-9]*)$/', $match, $m ) ) {
$width = intval( $m[1] );