Skip to content

Commit

Permalink
Disable '$...$' because breaks too many things
Browse files Browse the repository at this point in the history
  • Loading branch information
xeyownt committed May 1, 2019
1 parent 1810d87 commit 4afdc22
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion MathJax_body.php
Expand Up @@ -34,7 +34,8 @@ static function RemoveMathTags(&$parser, &$text)
static function ReplaceByMarkers(Parser &$parser, &$text )
{
$text = preg_replace_callback('/(\$\$)(.*?)(\$\$)/s', 'MathJax_Parser::Marker',$text);
$text = preg_replace_callback('|(?<![\{\/\:\\\\])(\$)(.*?)(?<![\\\\])(\$)|s', 'MathJax_Parser::Marker', $text);
// Disable $...$ replace because breaks too many things
// $text = preg_replace_callback('|(?<![\{\/\:\\\\])(\$)(.*?)(?<![\\\\])(\$)|s', 'MathJax_Parser::Marker', $text);
$text = preg_replace_callback('/(\\\\\[)(.*?)(\\\\\])/s', 'MathJax_Parser::Marker', $text);
$text = preg_replace_callback('/(\\\\\()(.*?)(\\\\\))/s', 'MathJax_Parser::Marker', $text);
$text = preg_replace_callback('/(\\\begin{(?:.*?)})(.*?)(\\\end{(?:.*?)})/s', 'MathJax_Parser::Marker', $text);
Expand Down
2 changes: 1 addition & 1 deletion modules/ext.MjCDN.js
Expand Up @@ -9,7 +9,7 @@ $.getScript( '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js',
"HTML-CSS": { scale: mw.config.get('wgMjSize') },
tex2jax: {
inlineMath: [ ['$$','$$'], ["\\(","\\)"] ],
displayMath: [ ['$','$'], ["\\[","\\]"] ],
displayMath: [ ["\\[","\\]"] ],
processEscapes: true,
element: "content",
ignoreClass: "(tex2jax_ignore|mw-search-results|searchresults)", /* note: this is part of a regex, check the docs! */
Expand Down
2 changes: 1 addition & 1 deletion modules/ext.MjLocal.js
Expand Up @@ -11,7 +11,7 @@ $.getScript( mw.config.get('wgExtensionAssetsPath') + '/MathJax/modules/MathJax/
"HTML-CSS": { scale: mw.config.get('wgMjSize') },
tex2jax: {
inlineMath: [ ['$$','$$'], ["\\(","\\)"] ],
displayMath: [ ['$','$'], ["\\[","\\]"] ],
displayMath: [ ["\\[","\\]"] ],
processEscapes: true,
element: "content",
ignoreClass: "(tex2jax_ignore|mw-search-results|searchresults)", /* note: this is part of a regex, check the docs! */
Expand Down

0 comments on commit 4afdc22

Please sign in to comment.