From bd24e83c8188866d37c1468d948d44692e6547a4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Oct 2010 18:55:02 -0700 Subject: --mathjax: Use mathjax with raw latex rather than mathml. It seems to work better, and the default config can be used. --- src/Text/Pandoc/Writers/HTML.hs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 7374cb343..b8da4bec0 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -503,18 +503,10 @@ inlineToHtml opts inline = Left _ -> inlineListToHtml opts (readTeXMath str) >>= return . (thespan ! [theclass "math"]) - MathJax _ -> do - let dt = if t == InlineMath - then DisplayInline - else DisplayBlock - let conf = useShortEmptyTags (const False) - defaultConfigPP - case texMathToMathML dt str of - Right r -> return $ primHtml $ - ppcElement conf r - Left _ -> inlineListToHtml opts - (readTeXMath str) >>= return . - (thespan ! [theclass "math"]) + MathJax _ -> return $ primHtml $ + case t of + InlineMath -> "\\(" ++ str ++ "\\)" + DisplayMath -> "\\[" ++ str ++ "\\]" PlainMath -> do x <- inlineListToHtml opts (readTeXMath str) let m = thespan ! [theclass "math"] $ x -- cgit v1.2.3 From 21556e37f4596cd7020337f1a8f039364c47c04b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 9 Nov 2010 22:51:02 -0800 Subject: Allow HTML comments as inline elements in markdown. So, aaa bbb can be a single paragraph. --- src/Text/Pandoc/Readers/Markdown.hs | 2 +- tests/markdown-reader-more.native | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 8c6a90edb..b655ea1a9 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1302,7 +1302,7 @@ rawHtmlInline' = do st <- getState result <- if stateStrict st then choice [htmlBlockElement, anyHtmlTag, anyHtmlEndTag] - else anyHtmlInlineTag + else choice [htmlComment, anyHtmlInlineTag] return $ HtmlInline result #ifdef _CITEPROC diff --git a/tests/markdown-reader-more.native b/tests/markdown-reader-more.native index 200855a09..884fe868e 100644 --- a/tests/markdown-reader-more.native +++ b/tests/markdown-reader-more.native @@ -18,8 +18,8 @@ Pandoc (Meta {docTitle = [Str "Title",Space,Str "spanning",Space,Str "multiple", , Para [Math InlineMath "\\$2 + \\$3"] , Header 2 [Str "Commented",Str "-",Str "out",Space,Str "list",Space,Str "item"] , BulletList - [ [ Plain [Str "one"] - , RawHtml "" ], [ Plain [Str "three"] ] ] + [ [ Plain [Str "one",Space,HtmlInline ""] ] + , [ Plain [Str "three"] ] ] , Header 2 [Str "Backslash",Space,Str "newline"] , Para [Str "hi",LineBreak,Str "there"] , Header 2 [Str "Code",Space,Str "spans"] -- cgit v1.2.3