git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: Enclose all LaTeXMathML bits in <span class="LaTeX">.
4d5c71efiddlosopher
Text/Pandoc/Writers/HTML.hs+7−3
@@ -459,9 +459,13 @@ inlineToHtml opts inline =
459 modify (\st -> st {stMath = True}) >>
459 modify (\st -> st {stMath = True}) >>
460 (case writerHTMLMathMethod opts of
460 (case writerHTMLMathMethod opts of
461 LaTeXMathML _ ->
461 LaTeXMathML _ ->
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"] $
462− return $ if t == InlineMath
466+ if t == InlineMath
463− then primHtml ("$" ++ str ++ "$")
467+ then primHtml ("$" ++ str ++ "$")
464− else primHtml ("$$" ++ str ++ "$$")
468+ else primHtml ("$$" ++ str ++ "$$")
465 MimeTeX url ->
469 MimeTeX url ->
466 return $ image ! [src (url ++ "?" ++ str),
470 return $ image ! [src (url ++ "?" ++ str),
467 alt str, title str]
471 alt str, title str]