git.iko.soy/typeable/pandoc
on master help sign in
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

commit4d5c71e183f443306033bdc53e0d2e8144af31d3 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 15 Sep 2008, 22:43 (18 years ago) parent4681b4a
1 file changed+7−3
Text/Pandoc/Writers/HTML.hs+7−3
Text/Pandoc/Writers/HTML.hs+7−3
@@ -459,9 +459,13 @@ inlineToHtml opts inline =
459459 modify (\st -> st {stMath = True}) >>
460460 (case writerHTMLMathMethod opts of
461461 LaTeXMathML _ ->
462− return $ if t == InlineMath
463− then primHtml ("$" ++ str ++ "$")
464− else primHtml ("$$" ++ str ++ "$$")
462+ -- putting LaTeXMathML in container with class "LaTeX" prevents
463+ -- non-math elements on the page from being treated as math by
464+ -- the javascript
465+ return $ thespan ! [theclass "LaTeX"] $
466+ if t == InlineMath
467+ then primHtml ("$" ++ str ++ "$")
468+ else primHtml ("$$" ++ str ++ "$$")
465469 MimeTeX url ->
466470 return $ image ! [src (url ++ "?" ++ str),
467471 alt str, title str]