From fc31bf27f575a0ac04c155539a095eb07fc996cc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 15 Sep 2012 21:06:55 -0700 Subject: MediaWiki reader: Allow table in table cell. --- src/Text/Pandoc/Readers/MediaWiki.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3