@@ -168,7 +168,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
168168 ([("id", takeBaseName $ eRelativePath ent),
169169 ("href", eRelativePath ent),
170170 ("media-type", "application/xhtml+xml")]
171− ++ [("properties","mathml switch") | epub3 &&
171+ ++ [("properties","mathml") | epub3 &&
172172 containsMathML ent]) $ ()
173173 let chapterRefNode ent = unode "itemref" !
174174 [("idref", takeBaseName $ eRelativePath ent)] $ ()
@@ -383,17 +383,12 @@ transformInlines _ sourceDir picsRef (Image lab (src,tit) : xs) = do
383383 return new
384384 return $ Image lab (newsrc, tit) : xs
385385transformInlines (MathML _) _ _ (x@(Math _ _) : xs) = do
386+ -- note: ideally we'd use a switch statement to provide a fallback
387+ -- but switch does not seem to be widely implemented yet, so we just
388+ -- provide the mathml
386389 let writeHtmlInline opts z = trimr $
387390 writeHtmlString opts $ Pandoc (Meta [] [] []) [Plain [z]]
388− mathml = writeHtmlInline def{writerHTMLMathMethod = MathML Nothing } x
389− -- we use mathjax to get raw latex, since readers tend to
390− -- fall back to using mathjax...
391− fallback = writeHtmlInline def{writerHTMLMathMethod = MathJax "" } x
392− inSwitch = "<epub:switch><epub:case required-namespace=" ++
393− "\"http://www.w3.org/1998/Math/MathML\">" ++ mathml ++
394− "</epub:case><epub:default>" ++ fallback ++
395− "</epub:default></epub:switch>"
396− result = if "<math" `isPrefixOf` mathml then inSwitch else mathml
391+ result = writeHtmlInline def{writerHTMLMathMethod = MathML Nothing } x
397392 return $ RawInline "html" result : xs
398393transformInlines _ _ _ xs = return xs
399394