mediawiki reader: allow space before table rows.

This commit is contained in:
John MacFarlane 2013-03-27 08:45:51 -07:00
parent ba1e74dcd7
commit 351b3e09c3

View file

@ -219,17 +219,17 @@ parseAttr = try $ do
return (k,v)
tableStart :: MWParser ()
tableStart = try $ guardColumnOne *> sym "{|"
tableStart = try $ guardColumnOne *> skipSpaces *> sym "{|"
tableEnd :: MWParser ()
tableEnd = try $ guardColumnOne *> sym "|}"
tableEnd = try $ guardColumnOne *> skipSpaces *> sym "|}"
rowsep :: MWParser ()
rowsep = try $ guardColumnOne *> sym "|-" <* blanklines
rowsep = try $ guardColumnOne *> skipSpaces *> sym "|-" <* blanklines
cellsep :: MWParser ()
cellsep = try $
(guardColumnOne <*
(guardColumnOne *> skipSpaces <*
( (char '|' <* notFollowedBy (oneOf "-}+"))
<|> (char '!')
)
@ -240,6 +240,7 @@ cellsep = try $
tableCaption :: MWParser Inlines
tableCaption = try $ do
guardColumnOne
skipSpaces
sym "|+"
skipMany spaceChar
res <- anyLine >>= parseFromString (many inline)