summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/MediaWiki.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-21 21:28:24 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-21 21:28:24 +0100
commit5269724ad39dfbbd473ae559aa2fff9ba7e5ee3b (patch)
tree0dd60a4391f83fd9719d0049aa7e7e8ad3b5cc4f /src/Text/Pandoc/Readers/MediaWiki.hs
parent1d06e8c5a5e34d7d1373b1c2839ebf57a2fc0546 (diff)
MediaWiki reader: fixed more table issues.
Closes #2649.
Diffstat (limited to 'src/Text/Pandoc/Readers/MediaWiki.hs')
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index f0d01136f..cdd1ce99f 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -219,7 +219,9 @@ para = do
table :: PandocMonad m => MWParser m Blocks
table = do
tableStart
- styles <- option [] parseAttrs <* blanklines
+ styles <- option [] parseAttrs
+ skipMany spaceChar
+ optional blanklines
let tableWidth = case lookup "width" styles of
Just w -> fromMaybe 1.0 $ parseWidth w
Nothing -> 1.0
@@ -267,14 +269,10 @@ rowsep = try $ guardColumnOne *> skipSpaces *> sym "|-" <*
many (char '-') <* optional parseAttr <* blanklines
cellsep :: PandocMonad m => MWParser m ()
-cellsep = try $
- (guardColumnOne *> skipSpaces <*
- ( (char '|' <* notFollowedBy (oneOf "-}+"))
- <|> (char '!')
- )
- )
- <|> (() <$ try (string "||"))
- <|> (() <$ try (string "!!"))
+cellsep = try $ do
+ skipSpaces
+ (char '|' *> notFollowedBy (oneOf "-}+") *> optional (char '|'))
+ <|> (char '!' *> optional (char '!'))
tableCaption :: PandocMonad m => MWParser m Inlines
tableCaption = try $ do