Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2309
patch3504.txt
Public
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 8:49 PM
2014-11-21 20:49:47 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
patch3504.txt
View Options
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
Details
Attached
Mime Type
text/html
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1885
Default Alt Text
patch3504.txt (1 KB)
Attached To
Mode
T5504: MathML with input <math>hello</math> causes tidy to die
Attached
Detach File
Event Timeline
Log In to Comment