git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: Handle table rows containing just an HTML comment.
ca40aceJohn MacFarlane
src/Text/Pandoc/Readers/MediaWiki.hs+2−1
@@ -227,6 +227,7 @@ table = do
227 let widths' = map (\w -> if w == 0 then defaultwidth else w) widths
227 let widths' = map (\w -> if w == 0 then defaultwidth else w) widths
228 let cellspecs = zip (map fst cellspecs') widths'
228 let cellspecs = zip (map fst cellspecs') widths'
229 rows' <- many $ try $ rowsep *> (map snd <$> tableRow)
229 rows' <- many $ try $ rowsep *> (map snd <$> tableRow)
230+ optional blanklines
230 tableEnd
231 tableEnd
231 let cols = length hdr
232 let cols = length hdr
232 let (headers,rows) = if hasheader
233 let (headers,rows) = if hasheader
@@ -275,7 +276,7 @@ tableCaption = try $ do
275 (trimInlines . mconcat) <$> many (notFollowedBy (cellsep <|> rowsep) *> inline)
276 (trimInlines . mconcat) <$> many (notFollowedBy (cellsep <|> rowsep) *> inline)
276
277
277tableRow :: MWParser [((Alignment, Double), Blocks)]
278tableRow :: MWParser [((Alignment, Double), Blocks)]
278−tableRow = try $ many tableCell
279+tableRow = try $ skipMany htmlComment *> many tableCell
279
280
280tableCell :: MWParser ((Alignment, Double), Blocks)
281tableCell :: MWParser ((Alignment, Double), Blocks)
281tableCell = try $ do
282tableCell = try $ do