MediaWiki reader: Support <math> tag.

This commit is contained in:
John MacFarlane 2012-09-12 19:54:56 -07:00
parent def768cd1f
commit b703c76540
3 changed files with 11 additions and 2 deletions

View file

@ -39,7 +39,6 @@ _ support internal links http://www.mediawiki.org/wiki/Help:Links
_ support external links (partially implemented)
_ support images http://www.mediawiki.org/wiki/Help:Images
_ support tables http://www.mediawiki.org/wiki/Help:Tables
_ support <math> tag for latex math
_ raw mediawiki:
_ templates or anything in {{}} (can be postprocessed)
_ category links
@ -259,6 +258,7 @@ inline = whitespace
<|> strikeout
<|> subscript
<|> superscript
<|> math
<|> code
<|> hask
<|> B.singleton <$> charRef
@ -320,6 +320,9 @@ superscript = B.superscript <$> inlinesInTags "sup"
subscript :: MWParser Inlines
subscript = B.subscript <$> inlinesInTags "sub"
math :: MWParser Inlines
math = B.math <$> charsInTags "math"
code :: MWParser Inlines
code = B.code <$> (charsInTags "code" <|> charsInTags "tt")

View file

@ -129,4 +129,6 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
[[Plain [Str "five",Space,Str "sub",Space,Str "1"]
,OrderedList (1,DefaultStyle,DefaultDelim)
[[Plain [Str "five",Space,Str "sub",Space,Str "1",Space,Str "sub",Space,Str "1"]]]]
,[Plain [Str "five",Space,Str "sub",Space,Str "2"]]]]]]
,[Plain [Str "five",Space,Str "sub",Space,Str "2"]]]]]
,Header 2 [Str "math"]
,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Math InlineMath "x=\\frac{y^\\pi}{z}",Str "."]]

View file

@ -189,3 +189,7 @@ ends the list.
### five sub 1 sub 1
## five sub 2
== math ==
Here is some <math>x=\frac{y^\pi}{z}</math>.