Permalink
Browse files

Stop htmlifying special characters in math spans and blocks.

I don't understand why I was filtering the equation text through
htmlspecialchars in the first place--obviously the wrong thing to do.
  • Loading branch information...
1 parent 9bfed8b commit 2f0f0f7c7f2b59e540ef7875d17949df16c52b43 @drdrang committed Mar 11, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 markdown.php
View
@@ -1155,7 +1155,8 @@ function doDisplayMath($text) {
}
function _doDisplayMath_callback($matches) {
$texblock = $matches[1];
- $texblock = htmlspecialchars(trim($texblock), ENT_NOQUOTES);
+ # $texblock = htmlspecialchars(trim($texblock), ENT_NOQUOTES);
+ $texblock = trim($texblock);
if (MARKDOWN_MATH_TYPE == "mathjax") {
$texblock = "<span class=\"MathJax_Preview\">[$texblock]</span><script type=\"math/tex; mode=display\">$texblock</script>";
} else {
@@ -1177,7 +1178,8 @@ function makeInlineMath($tex) {
#
# Create a code span markup for $tex. Called from handleSpanToken.
#
- $tex = htmlspecialchars(trim($tex), ENT_NOQUOTES);
+ # $tex = htmlspecialchars(trim($tex), ENT_NOQUOTES);
+ $tex = trim($tex);
if (MARKDOWN_MATH_TYPE == "mathjax") {
return $this->hashPart("<span class=\"MathJax_Preview\">[$tex]</span><script type=\"math/tex\">$tex</script>");
} else {

0 comments on commit 2f0f0f7

Please sign in to comment.