From 4d5c71e183f443306033bdc53e0d2e8144af31d3 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Mon, 15 Sep 2008 22:43:21 +0000 Subject: HTML writer: Enclose all LaTeXMathML bits in . 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 --- Text/Pandoc/Writers/HTML.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Text/Pandoc/Writers/HTML.hs') 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] -- cgit v1.2.3