@@ -171,7 +171,7 @@ table = do
171 rows' <- many $ try $ rowsep *> tableRow
171 rows' <- many $ try $ rowsep *> tableRow
173 -- TODO handle cellspecs from styles and aligns...
173 -- TODO handle cellspecs from styles and aligns...
174− let cols = length $ head rows'
174+ let cols = length hdr
175 let (headers,rows) = if hasheader
175 let (headers,rows) = if hasheader
176 then (hdr, rows')
176 then (hdr, rows')
177 else (replicate cols mempty, hdr:rows')
177 else (replicate cols mempty, hdr:rows')
@@ -197,11 +197,12 @@ tableCaption = try $ guardColumnOne *> sym "|+" *> skipMany spaceChar *>
197 (trimInlines . mconcat <$> (many inline)) <* skipMany blankline
197 (trimInlines . mconcat <$> (many inline)) <* skipMany blankline
199tableRow :: MWParser [Blocks]
199tableRow :: MWParser [Blocks]
200−tableRow = try $ many tableCell <* skipMany blankline
200+tableRow = try $ many tableCell
202tableCell :: MWParser Blocks
202tableCell :: MWParser Blocks
203tableCell =
203tableCell =
204− try $ cellsep *> skipMany spaceChar *> (mconcat <$> (many block))
204+ try $ cellsep *> skipMany spaceChar *>
205+ (mconcat <$> (many $ notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> block))
206template :: MWParser Blocks
207template :: MWParser Blocks
207template = B.rawBlock "mediawiki" <$> doublebrackets
208template = B.rawBlock "mediawiki" <$> doublebrackets
@@ -405,7 +406,9 @@ inlineTag = do
406special :: MWParser Inlines
407special :: MWParser Inlines
407special = B.str <$> count 1 (notFollowedBy' (htmlTag isBlockTag') *>
408special = B.str <$> count 1 (notFollowedBy' (htmlTag isBlockTag') *>
409+-- notFollowedBy (tableStart <|> tableEnd
410+-- <|> cellsep <|> rowsep) *>
408− notFollowedBy (char '|') *> oneOf specialChars)
411+ oneOf specialChars)
410inlineHtml :: MWParser Inlines
413inlineHtml :: MWParser Inlines
411inlineHtml = B.rawInline "html" . snd <$> htmlTag isInlineTag
414inlineHtml = B.rawInline "html" . snd <$> htmlTag isInlineTag
@@ -418,8 +421,10 @@ endline = () <$ try (newline <*
418 notFollowedBy blankline <*
421 notFollowedBy blankline <*
419 notFollowedBy' hrule <*
422 notFollowedBy' hrule <*
420 notFollowedBy tableStart <*
423 notFollowedBy tableStart <*
424+ notFollowedBy tableEnd <*
421 notFollowedBy' template <*
425 notFollowedBy' template <*
422 notFollowedBy cellsep <*
426 notFollowedBy cellsep <*
427+ notFollowedBy rowsep <*
423 notFollowedBy anyListStart)
428 notFollowedBy anyListStart)
425image :: MWParser Inlines
430image :: MWParser Inlines