37 $this->mMarkerIndex = 0;
41 [ $this,
'replaceCallback' ], $text );
43 $wrappedtext = preg_replace_callback(
'/<\\/?mw:toc>/',
44 [ $this,
'replaceCallback' ], $wrappedtext );
46 $wrappedtext = preg_replace_callback(
'/<math(.*?)<\\/math>/s',
47 [ $this,
'replaceCallback' ], $wrappedtext );
50 $wrappedtext = preg_replace(
'!<(link|meta)([^>]*?)(/{0,1}>)!',
'<html-$1$2$3', $wrappedtext );
52 $wrappedtext = preg_replace_callback(
'!<style([^>]*)>(.*?)</style>!s',
function ( $m ) {
53 return '<html-style' . $m[1] .
'>'
60 $wrappedtext = preg_replace(
"!<li>([ \r\n\t\f]*)</li>!",
61 '<li datafld="" class="mw-empty-elt">\1</li>', $wrappedtext );
64 $wrappedtext =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' .
65 ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>' .
66 '<head><title>test</title></head><body>' . $wrappedtext .
'</body></html>';
76 $marker = Parser::MARKER_PREFIX .
"-item-{$this->mMarkerIndex}" . Parser::MARKER_SUFFIX;
77 $this->mMarkerIndex++;
78 $this->mTokens[$marker] = $m[0];
88 $text = preg_replace(
'!<html-(link|meta)([^>]*?)(/{0,1}>)!',
'<$1$2$3', $text );
89 $text = preg_replace(
'!<(/?)html-(style)([^>]*)>!',
'<$1$2$3>', $text );
92 $text = str_replace(
'<li datafld=""',
'<li', $text );
95 $text = strtr( $text, $this->mTokens );