*
* settings:
* $wgUseTex*, $wgUseDynamicDates*, $wgInterwikiMagic*,
- * $wgNamespacesWithSubpages, $wgLanguageCode, $wgAllowExternalImages*,
+ * $wgNamespacesWithSubpages, $wgAllowExternalImages*,
* $wgLocaltimezone
*
* * only within ParserOptions
#$text = str_replace( $uniq_prefix, wfHtmlEscapeFirst( $uniq_prefix ), $text );
# html
- global $wgRawHtml;
- if( $wgRawHtml ) {
+ global $wgRawHtml, $wgWhitelistEdit;
+ if( $wgRawHtml && $wgWhitelistEdit ) {
$text = Parser::extractTags('html', $text, $html_content, $uniq_prefix);
foreach( $html_content as $marker => $content ) {
if ($render ) {
return $t ;
}
- # Parses the text and adds the result to the strip state
- # Returns the strip tag
- function stripParse( $text, $newline, $args ) {
- $text = $this->strip( $text, $this->mStripState );
- $text = $this->internalParse( $text, (bool)$newline, $args, false );
- return $newline.$this->insertStripItem( $text, $this->mStripState );
- }
-
function internalParse( $text, $linestart, $args = array(), $isMain=true ) {
+ global $wgLang;
+
$fname = 'Parser::internalParse';
wfProfileIn( $fname );
$text = $this->removeHTMLtags( $text );
$text = $this->replaceVariables( $text, $args );
+ $text = $wgLang->convert($text);
+
$text = preg_replace( '/(^|\n)-----*/', '\\1<hr />', $text );
$text = $this->doHeadings( $text );
# The wikilinks [[ ]] are procedeed here.
/* private */ function replaceInternalLinks( $s ) {
global $wgLang, $wgLinkCache;
- global $wgNamespacesWithSubpages, $wgLanguageCode;
+ global $wgNamespacesWithSubpages;
static $fname = 'Parser::replaceInternalLinks' ;
wfProfileIn( $fname );
$output .= $this->closeParagraph().'<pre>';
$this->mLastSection = 'pre';
}
+ $t = substr( $t, 1 );
} else {
// paragraph
if ( '' == trim($t) ) {
# Add a new element to the templace recursion path
$this->mTemplatePath[$part1] = 1;
- $text = $this->stripParse( $text, $newline, $assocArgs );
+ $text = $this->removeHTMLtags( $text );
+ $text = $this->replaceVariables( $text, $assocArgs );
# Resume the link cache and register the inclusion as a link
if ( !is_null( $title ) ) {
$inputArgs = end( $this->mArgStack );
if ( array_key_exists( $arg, $inputArgs ) ) {
- $text = $this->stripParse( $inputArgs[$arg], $newline, array() );
+ $text = $this->removeHTMLtags( $inputArgs[$arg] );
+ $text = $this->replaceVariables( $text, array() );
}
return $text;
$htmlattrs = $this->getHTMLattrs () ;
# Remove HTML comments
- $text = preg_replace( '/(\\n *<!--.*--> *(?=\\n)|<!--.*-->)/sU', '$2', $text );
+ $text = preg_replace( '/(\\n *<!--.*--> *|<!--.*?-->)/sU', '', $text );
$bits = explode( '<', $text );
$text = array_shift( $bits );