git.iko.soy/typeable/pandoc
on master help sign in
Merge branch 'master' into citeproc
83e6c01John MacFarlane
@@ -347,11 +347,6 @@ For further documentation, see the `pandoc(1)` man page.
347\--mathjax=*URL*
347\--mathjax=*URL*
348: causes `pandoc` to use [MathJax] to display embedded TeX math in HTML
348: causes `pandoc` to use [MathJax] to display embedded TeX math in HTML
349 output. The *URL* should point to the `MathJax.js` load script.
349 output. The *URL* should point to the `MathJax.js` load script.
350− Pandoc will use MathML with MathJax, so your `config/MathJax.js`
351− file should contain the following settings:
352−
353− extensions: ["mml2jax.js"],
354− jax: ["input/MathML", "output/HTML-CSS"],
355
350
356`--gladtex`*[=url]*
351`--gladtex`*[=url]*
357: causes TeX formulas to be enclosed in `<eq>` tags in HTML, Slidy, or
352: causes TeX formulas to be enclosed in `<eq>` tags in HTML, Slidy, or
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -1300,7 +1300,7 @@ rawHtmlInline' = do
1300 st <- getState
1300 st <- getState
1301 result <- if stateStrict st
1301 result <- if stateStrict st
1302 then choice [htmlBlockElement, anyHtmlTag, anyHtmlEndTag]
1302 then choice [htmlBlockElement, anyHtmlTag, anyHtmlEndTag]
1303− else anyHtmlInlineTag
1303+ else choice [htmlComment, anyHtmlInlineTag]
1304 return $ HtmlInline result
1304 return $ HtmlInline result
1305
1305
1306inlineCitation :: GenParser Char ParserState Inline
1306inlineCitation :: GenParser Char ParserState Inline
src/Text/Pandoc/Writers/HTML.hs+4−12
@@ -503,18 +503,10 @@ inlineToHtml opts inline =
503 Left _ -> inlineListToHtml opts
503 Left _ -> inlineListToHtml opts
504 (readTeXMath str) >>= return .
504 (readTeXMath str) >>= return .
505 (thespan ! [theclass "math"])
505 (thespan ! [theclass "math"])
506− MathJax _ -> do
506+ MathJax _ -> return $ primHtml $
507− let dt = if t == InlineMath
507+ case t of
508− then DisplayInline
508+ InlineMath -> "\\(" ++ str ++ "\\)"
509− else DisplayBlock
509+ DisplayMath -> "\\[" ++ str ++ "\\]"
510− let conf = useShortEmptyTags (const False)
511− defaultConfigPP
512− case texMathToMathML dt str of
513− Right r -> return $ primHtml $
514− ppcElement conf r
515− Left _ -> inlineListToHtml opts
516− (readTeXMath str) >>= return .
517− (thespan ! [theclass "math"])
518 PlainMath -> do
510 PlainMath -> do
519 x <- inlineListToHtml opts (readTeXMath str)
511 x <- inlineListToHtml opts (readTeXMath str)
520 let m = thespan ! [theclass "math"] $ x
512 let m = thespan ! [theclass "math"] $ x
tests/markdown-reader-more.native+2−2
@@ -18,8 +18,8 @@ Pandoc (Meta {docTitle = [Str "Title",Space,Str "spanning",Space,Str "multiple",
18, Para [Math InlineMath "\\$2 + \\$3"]
18, Para [Math InlineMath "\\$2 + \\$3"]
19, Header 2 [Str "Commented",Str "-",Str "out",Space,Str "list",Space,Str "item"]
19, Header 2 [Str "Commented",Str "-",Str "out",Space,Str "list",Space,Str "item"]
20, BulletList
20, BulletList
21− [ [ Plain [Str "one"]
21+ [ [ Plain [Str "one",Space,HtmlInline "<!--\n- two\n-->"] ]
22− , RawHtml "<!--\n- two\n-->" ], [ Plain [Str "three"] ] ]
22+ , [ Plain [Str "three"] ] ]
23, Header 2 [Str "Backslash",Space,Str "newline"]
23, Header 2 [Str "Backslash",Space,Str "newline"]
24, Para [Str "hi",LineBreak,Str "there"]
24, Para [Str "hi",LineBreak,Str "there"]
25, Header 2 [Str "Code",Space,Str "spans"]
25, Header 2 [Str "Code",Space,Str "spans"]