From 0b15448d646ba2e2b8db523e9065f820cfa179ba Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 1 Dec 2007 03:11:44 +0000 Subject: Added HTMLMathMethod writer option. This selects between asciimathml, mimetex, gladtex, and plain math. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1123 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Writers/HTML.hs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'Text/Pandoc/Writers') diff --git a/Text/Pandoc/Writers/HTML.hs b/Text/Pandoc/Writers/HTML.hs index b933064fc..0085e5419 100644 --- a/Text/Pandoc/Writers/HTML.hs +++ b/Text/Pandoc/Writers/HTML.hs @@ -100,11 +100,14 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) = else style ! [thetype "text/css"] $ primHtml $ '\n':(unlines $ S.toList cssLines) math = if stMath newstate - then case writerASCIIMathMLURL opts of - Just path -> script ! [src path, - thetype "text/javascript"] $ - noHtml - Nothing -> primHtml asciiMathMLScript + then case writerHTMLMathMethod opts of + ASCIIMathML Nothing -> + primHtml asciiMathMLScript + ASCIIMathML (Just url) -> + script ! + [src url, thetype "text/javascript"] $ + noHtml + _ -> noHtml else noHtml head = header $ metadata +++ math +++ css +++ primHtml (writerHeader opts) @@ -397,10 +400,13 @@ inlineToHtml opts inline = primHtmlChar "rdquo") in do contents <- inlineListToHtml opts lst return $ leftQuote +++ contents +++ rightQuote - (Math str) -> (if writerUseASCIIMathML opts - then modify (\st -> st {stMath = True}) - else return ()) >> - return (stringToHtml ("$" ++ str ++ "$")) + (Math str) -> modify (\st -> st {stMath = True}) >> + (return $ case writerHTMLMathMethod opts of + ASCIIMathML _ -> + stringToHtml ("$" ++ str ++ "$") + GladTeX -> + tag "eq" << str + _ -> stringToHtml ("$" ++ str ++ "$")) (TeX str) -> return noHtml (HtmlInline str) -> return $ primHtml str (Link [Code str] (src,tit)) | "mailto:" `isPrefixOf` src -> -- cgit v1.2.3