aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-15 22:43:21 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-15 22:43:21 +0000
commit4d5c71e183f443306033bdc53e0d2e8144af31d3 (patch)
tree9da21d3913b207e91d499a28f5440ebe48588d48 /Text/Pandoc/Writers
parent4681b4a54cbc25a80f8729162c25f65d6fc6724d (diff)
downloadpandoc-4d5c71e183f443306033bdc53e0d2e8144af31d3.tar.gz
HTML writer: Enclose all LaTeXMathML bits in <span class="LaTeX">.
This prevents parts of the document that are not math from being interpreted as math by LaTeXMathML.js. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1453 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc/Writers')
-rw-r--r--Text/Pandoc/Writers/HTML.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Text/Pandoc/Writers/HTML.hs b/Text/Pandoc/Writers/HTML.hs
index b1e6dabc1..0870c7e18 100644
--- a/Text/Pandoc/Writers/HTML.hs
+++ b/Text/Pandoc/Writers/HTML.hs
@@ -459,9 +459,13 @@ inlineToHtml opts inline =
modify (\st -> st {stMath = True}) >>
(case writerHTMLMathMethod opts of
LaTeXMathML _ ->
- return $ if t == InlineMath
- then primHtml ("$" ++ str ++ "$")
- else primHtml ("$$" ++ str ++ "$$")
+ -- putting LaTeXMathML in container with class "LaTeX" prevents
+ -- non-math elements on the page from being treated as math by
+ -- the javascript
+ return $ thespan ! [theclass "LaTeX"] $
+ if t == InlineMath
+ then primHtml ("$" ++ str ++ "$")
+ else primHtml ("$$" ++ str ++ "$$")
MimeTeX url ->
return $ image ! [src (url ++ "?" ++ str),
alt str, title str]