diff options
-rw-r--r-- | src/Text/Pandoc/Readers/MediaWiki.hs | 5 | ||||
-rw-r--r-- | tests/mediawiki-reader.native | 4 | ||||
-rw-r--r-- | tests/mediawiki-reader.wiki | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs index 3bf4a0cdb..8805d528a 100644 --- a/src/Text/Pandoc/Readers/MediaWiki.hs +++ b/src/Text/Pandoc/Readers/MediaWiki.hs @@ -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") diff --git a/tests/mediawiki-reader.native b/tests/mediawiki-reader.native index beb76c40c..c823bafaf 100644 --- a/tests/mediawiki-reader.native +++ b/tests/mediawiki-reader.native @@ -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 "."]] diff --git a/tests/mediawiki-reader.wiki b/tests/mediawiki-reader.wiki index 5edaa2e16..b03c0f72d 100644 --- a/tests/mediawiki-reader.wiki +++ b/tests/mediawiki-reader.wiki @@ -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>. + |