git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: || between table cells.
commitaa476b42cb84cf1f0bdf187574e0f584dc5fea91 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 14 Sep 2012, 23:51 (14 years ago) parent152ddfb
1 file changed+10−9
src/Text/Pandoc/Readers/MediaWiki.hs+10−9
src/Text/Pandoc/Readers/MediaWiki.hs+10−9
@@ -189,8 +189,9 @@ rowsep = try $ guardColumnOne *> sym "|-" <* blanklines
189189
190190-- TODO add something like 'guard inTable' since this is used in endline
191191cellsep :: MWParser ()
192−cellsep = try $ guardColumnOne <*
193− (char '!' <|> (char '|' <* notFollowedBy (oneOf "-}+")))
192+cellsep = (try $ guardColumnOne <*
193+ (char '!' <|> (char '|' <* notFollowedBy (oneOf "-}+"))))
194+ <|> (() <$ try (string "||"))
194195
195196tableCaption :: MWParser Inlines
196197tableCaption = try $ do
@@ -207,16 +208,16 @@ tableCell :: MWParser Blocks
207208tableCell = try $ do
208209 cellsep
209210 skipMany spaceChar
210− ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyLine)
211− parseFromString (mconcat <$> many block) (unlines ls)
211+ ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyChar)
212+ parseFromString (mconcat <$> many block) ls
212213
213214template :: MWParser Blocks
214215template = B.rawBlock "mediawiki" <$> doublebrackets
215− where doublebrackets = try $ do
216− string "{{"
217− notFollowedBy (char '{')
218− contents <- manyTill anyChar (try $ string "}}")
219− return $ "{{" ++ contents ++ "}}"
216+ where doublebrackets = try $
217+ do string "{{"
218+ notFollowedBy (char '{')
219+ contents <- manyTill anyChar (try $ string "}}")
220+ return $ "{{" ++ contents ++ "}}"
220221
221222blockTag :: MWParser Blocks
222223blockTag = do