Page MenuHomePhabricator

patch3504.txt

Authored By
bzimport
Nov 21 2014, 8:49 PM
Size
1 KB
Referenced Files
None
Subscribers
None

patch3504.txt

Index: includes/Parser.php
===================================================================
RCS file: /cvsroot/blahtex/blahtex/includes/Parser.php,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 Parser.php
*** includes/Parser.php 23 Mar 2006 10:12:09 -0000 1.1.1.4
--- includes/Parser.php 24 Mar 2006 10:27:28 -0000
***************
*** 582,587 ****
--- 582,590 ----
* will be used depending on availability. Override the default
* $wgTidyInternal setting to disable the internal if it's not working.
*
+ * Since html tidy does not understand MathML, we temporarily replace
+ * all <math>...</math> with placeholders.
+ *
* @param string $text Hideous HTML input
* @return string Corrected HTML output
* @access public
***************
*** 589,594 ****
--- 592,600 ----
*/
function tidy( $text ) {
global $wgTidyInternal;
+ $math_content = array();
+ $text = Parser::extractTagsAndParams( 'math', $text, $math_content,
+ $math_tags, $math_params, $this->mUniqPrefix );
$wrappedtext = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'.
' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>'.
'<head><title>test</title></head><body>'.$text.'</body></html>';
***************
*** 600,605 ****
--- 606,615 ----
if( is_null( $correctedtext ) ) {
wfDebug( "Tidy error detected!\n" );
return $text . "\n<!-- Tidy found serious XHTML errors -->\n";
+ }
+ foreach( $math_content as $marker => $content ) {
+ $full_tag = $math_tags[$marker] . $content . "</math>";
+ $correctedtext = str_replace( $marker, $full_tag, $correctedtext );
}
return $correctedtext;
}

File Metadata

Mime Type
text/html
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1885
Default Alt Text
patch3504.txt (1 KB)

Event Timeline