aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-09-15 21:06:55 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-09-15 21:06:55 -0700
commitfc31bf27f575a0ac04c155539a095eb07fc996cc (patch)
tree4de9a5d1d1af4ed14d6c02af20c0b5de804385e0 /src/Text
parent14616931596ffd366f3a86930bc0d2b49c825b98 (diff)
downloadpandoc-fc31bf27f575a0ac04c155539a095eb07fc996cc.tar.gz
MediaWiki reader: Allow table in table cell.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index 38ffed835..7936be38b 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -30,6 +30,7 @@ Conversion of mediawiki text to 'Pandoc' document.
-}
{-
TODO:
+_ correctly handle tables within tables
_ parse templates?
-}
module Text.Pandoc.Readers.MediaWiki ( readMediaWiki ) where
@@ -255,7 +256,8 @@ tableCell = try $ do
attrs <- option [] $ try $ parseAttrs <$>
manyTill (satisfy (/='\n')) (char '|' <* notFollowedBy (char '|'))
skipMany spaceChar
- ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyChar)
+ ls <- concat <$> many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *>
+ ((snd <$> withRaw table) <|> count 1 anyChar))
bs <- parseFromString (mconcat <$> many block) ls
let align = case lookup "align" attrs of
Just "left" -> AlignLeft