From 4f28d47b90d8dde0de21d5db966520959ead8684 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 28 Oct 2008 21:54:50 +0000 Subject: Added --jsmath option. - Added --jsmath option to Main.hs - Added JsMath to HTMLMathMethod in Text.Pandoc.Shared. - Handle math appropriately in HTML writer when JsMath selected. - Documented the option in README and man page. Resolves Issue #68. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1472 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Writers/HTML.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Text/Pandoc/Writers/HTML.hs') diff --git a/Text/Pandoc/Writers/HTML.hs b/Text/Pandoc/Writers/HTML.hs index 628e784ed..8dafd2440 100644 --- a/Text/Pandoc/Writers/HTML.hs +++ b/Text/Pandoc/Writers/HTML.hs @@ -129,6 +129,10 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) = script ! [src url, thetype "text/javascript"] $ noHtml + JsMath (Just url) -> + script ! + [src url, thetype "text/javascript"] $ + noHtml _ -> noHtml else noHtml head' = header $ metadata +++ math +++ css +++ @@ -467,6 +471,10 @@ inlineToHtml opts inline = if t == InlineMath then primHtml ("$" ++ str ++ "$") else primHtml ("$$" ++ str ++ "$$") + JsMath _ -> + return $ if t == InlineMath + then thespan ! [theclass "math"] $ primHtml str + else thediv ! [theclass "math"] $ primHtml str MimeTeX url -> return $ image ! [src (url ++ "?" ++ str), alt str, title str] -- cgit v1.2.3