diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-11-09 22:52:36 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-11-09 22:52:36 -0800 |
commit | 83e6c01e4d393f642231ed76e7a44804ec781f66 (patch) | |
tree | 2e614b0cd1c3ac93b28d499d61e9381d80d3efb4 | |
parent | 07775b5f4fbe108dde4bd3729552c613b8f8d122 (diff) | |
parent | 21556e37f4596cd7020337f1a8f039364c47c04b (diff) | |
download | pandoc-83e6c01e4d393f642231ed76e7a44804ec781f66.tar.gz |
Merge branch 'master' into citeproc
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 16 | ||||
-rw-r--r-- | tests/markdown-reader-more.native | 4 |
4 files changed, 7 insertions, 20 deletions
@@ -347,11 +347,6 @@ For further documentation, see the `pandoc(1)` man page. \--mathjax=*URL* : causes `pandoc` to use [MathJax] to display embedded TeX math in HTML output. The *URL* should point to the `MathJax.js` load script. - Pandoc will use MathML with MathJax, so your `config/MathJax.js` - file should contain the following settings: - - extensions: ["mml2jax.js"], - jax: ["input/MathML", "output/HTML-CSS"], `--gladtex`*[=url]* : causes TeX formulas to be enclosed in `<eq>` tags in HTML, Slidy, or diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index a2ee93f42..b7c5220d1 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1300,7 +1300,7 @@ rawHtmlInline' = do st <- getState result <- if stateStrict st then choice [htmlBlockElement, anyHtmlTag, anyHtmlEndTag] - else anyHtmlInlineTag + else choice [htmlComment, anyHtmlInlineTag] return $ HtmlInline result inlineCitation :: GenParser Char ParserState Inline 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 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 "<!--\n- two\n-->" ], [ Plain [Str "three"] ] ] + [ [ Plain [Str "one",Space,HtmlInline "<!--\n- two\n-->"] ] + , [ Plain [Str "three"] ] ] , Header 2 [Str "Backslash",Space,Str "newline"] , Para [Str "hi",LineBreak,Str "there"] , Header 2 [Str "Code",Space,Str "spans"] |