@@ -193,16 +193,22 @@ cellsep = try $ guardColumnOne <*
193193 (char '!' <|> (char '|' <* notFollowedBy (oneOf "-}+")))
194194
195195tableCaption :: MWParser Inlines
196−tableCaption = try $ guardColumnOne *> sym "|+" *> skipMany spaceChar *>
197− (trimInlines . mconcat <$> (many inline)) <* skipMany blankline
196+tableCaption = try $ do
197+ guardColumnOne
198+ sym "|+"
199+ skipMany spaceChar
200+ res <- manyTill anyChar newline >>= parseFromString (many inline)
201+ return $ trimInlines $ mconcat res
198202
199203tableRow :: MWParser [Blocks]
200204tableRow = try $ many tableCell
201205
202206tableCell :: MWParser Blocks
203−tableCell =
204− try $ cellsep *> skipMany spaceChar *>
205− (mconcat <$> (many $ notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> block))
207+tableCell = try $ do
208+ cellsep
209+ skipMany spaceChar
210+ ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyLine)
211+ parseFromString (mconcat <$> many block) (unlines ls)
206212
207213template :: MWParser Blocks
208214template = B.rawBlock "mediawiki" <$> doublebrackets
@@ -406,8 +412,6 @@ inlineTag = do
406412
407413special :: MWParser Inlines
408414special = B.str <$> count 1 (notFollowedBy' (htmlTag isBlockTag') *>
409−-- notFollowedBy (tableStart <|> tableEnd
410−-- <|> cellsep <|> rowsep) *>
411415 oneOf specialChars)
412416
413417inlineHtml :: MWParser Inlines
@@ -421,10 +425,7 @@ endline = () <$ try (newline <*
421425 notFollowedBy blankline <*
422426 notFollowedBy' hrule <*
423427 notFollowedBy tableStart <*
424− notFollowedBy tableEnd <*
425428 notFollowedBy' template <*
426− notFollowedBy cellsep <*
427− notFollowedBy rowsep <*
428429 notFollowedBy anyListStart)
429430
430431image :: MWParser Inlines