@@ -193,16 +193,22 @@ cellsep = try $ guardColumnOne <*
193 (char '!' <|> (char '|' <* notFollowedBy (oneOf "-}+")))
193 (char '!' <|> (char '|' <* notFollowedBy (oneOf "-}+")))
195tableCaption :: MWParser Inlines
195tableCaption :: MWParser Inlines
196+tableCaption = try $ do
196−tableCaption = try $ guardColumnOne *> sym "|+" *> skipMany spaceChar *>
199+ skipMany spaceChar
200+ res <- manyTill anyChar newline >>= parseFromString (many inline)
197− (trimInlines . mconcat <$> (many inline)) <* skipMany blankline
201+ return $ trimInlines $ mconcat res
199tableRow :: MWParser [Blocks]
203tableRow :: MWParser [Blocks]
200tableRow = try $ many tableCell
204tableRow = try $ many tableCell
202tableCell :: MWParser Blocks
206tableCell :: MWParser Blocks
203−tableCell =
207+tableCell = try $ do
204− try $ cellsep *> skipMany spaceChar *>
209+ skipMany spaceChar
205− (mconcat <$> (many $ notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> block))
210+ ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyLine)
211+ parseFromString (mconcat <$> many block) (unlines ls)
207template :: MWParser Blocks
213template :: MWParser Blocks
208template = B.rawBlock "mediawiki" <$> doublebrackets
214template = B.rawBlock "mediawiki" <$> doublebrackets
@@ -406,8 +412,6 @@ inlineTag = do
407special :: MWParser Inlines
413special :: MWParser Inlines
408special = B.str <$> count 1 (notFollowedBy' (htmlTag isBlockTag') *>
414special = B.str <$> count 1 (notFollowedBy' (htmlTag isBlockTag') *>
409−-- notFollowedBy (tableStart <|> tableEnd
410−-- <|> cellsep <|> rowsep) *>
411 oneOf specialChars)
415 oneOf specialChars)
413inlineHtml :: MWParser Inlines
417inlineHtml :: MWParser Inlines
@@ -421,10 +425,7 @@ endline = () <$ try (newline <*
421 notFollowedBy blankline <*
425 notFollowedBy blankline <*
422 notFollowedBy' hrule <*
426 notFollowedBy' hrule <*
423 notFollowedBy tableStart <*
427 notFollowedBy tableStart <*
424− notFollowedBy tableEnd <*
425 notFollowedBy' template <*
428 notFollowedBy' template <*
426− notFollowedBy cellsep <*
427− notFollowedBy rowsep <*
428 notFollowedBy anyListStart)
429 notFollowedBy anyListStart)
430image :: MWParser Inlines
431image :: MWParser Inlines