$striparray=array();
$parser=new Parser();
$parser->mOutputType=OT_WIKI;
+ $parser->mOptions = new ParserOptions();
$striptext=$parser->strip($text, $striparray, true);
# now that we can be sure that no pseudo-sections are in the source,
$striparray=array();
$parser=new Parser();
$parser->mOutputType=OT_WIKI;
+ $parser->mOptions = new ParserOptions();
$oldtext=$parser->strip($oldtext, $striparray, true);
# now that we can be sure that no pseudo-sections are in the source,
}
# math
- $text = Parser::extractTags('math', $text, $math_content, $uniq_prefix);
- foreach( $math_content as $marker => $content ){
- if( $render ) {
- if( $this->mOptions->getUseTeX() ) {
+ if( $this->mOptions->getUseTeX() ) {
+ $text = Parser::extractTags('math', $text, $math_content, $uniq_prefix);
+ foreach( $math_content as $marker => $content ){
+ if( $render ) {
$math_content[$marker] = renderMath( $content );
} else {
- $math_content[$marker] = '<math>'.$content.'<math>';
+ $math_content[$marker] = '<math>'.$content.'</math>';
}
- } else {
- $math_content[$marker] = '<math>'.$content.'</math>';
}
}
$fc = substr ( $x , 0 , 1 ) ;
if ( preg_match( '/^(:*)\{\|(.*)$/', $x, $matches ) ) {
$indent_level = strlen( $matches[1] );
+
+ $attributes = $this->unstripForHTML( $matches[2] );
+
$t[$k] = str_repeat( '<dl><dd>', $indent_level ) .
- '<table' . Sanitizer::fixTagAttributes ( $matches[2], 'table' ) . '>' ;
+ '<table' . Sanitizer::fixTagAttributes ( $attributes, 'table' ) . '>' ;
array_push ( $td , false ) ;
array_push ( $ltd , '' ) ;
array_push ( $tr , false ) ;
array_push ( $tr , false ) ;
array_push ( $td , false ) ;
array_push ( $ltd , '' ) ;
- array_push ( $ltr , Sanitizer::fixTagAttributes ( $x, 'tr' ) ) ;
+ $attributes = $this->unstripForHTML( $x );
+ array_push ( $ltr , Sanitizer::fixTagAttributes ( $attributes, 'tr' ) ) ;
}
else if ( '|' == $fc || '!' == $fc || '|+' == substr ( $x , 0 , 2 ) ) { # Caption
# $x is a table row
}
if ( count ( $y ) == 1 )
$y = "{$z}<{$l}>{$y[0]}" ;
- else $y = $y = "{$z}<{$l}".Sanitizer::fixTagAttributes($y[0], $l).">{$y[1]}" ;
+ else {
+ $attributes = $this->unstripForHTML( $y[0] );
+ $y = "{$z}<{$l}".Sanitizer::fixTagAttributes($attributes, $l).">{$y[1]}" ;
+ }
$t[$k] .= $y ;
array_push ( $td , true ) ;
}
*/
function attributeStripCallback( &$text, $args ) {
$text = $this->replaceVariables( $text, $args );
+ $text = $this->unstripForHTML( $text );
+ return $text;
+ }
+
+ function unstripForHTML( $text ) {
$text = $this->unstrip( $text, $this->mStripState );
$text = $this->unstripNoWiki( $text, $this->mStripState );
return $text;