git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: allow `+` separators in pipe table cells.
6e950a8John MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+4−6
@@ -1382,16 +1382,14 @@ pipeTableRow' = do
1382 skipMany spaceChar
1382 skipMany spaceChar
1383 openPipe <- (True <$ char '|') <|> return False
1383 openPipe <- (True <$ char '|') <|> return False
1384 let cell = mconcat <$>
1384 let cell = mconcat <$>
1385− many (notFollowedBy (blankline <|> char '|') >> inline)
1385+ many (notFollowedBy (blankline <|> oneOf "+|") >> inline)
1386− first <- cell
1386+ cells <- cell `sepBy1` sepPipe
1387− rest <- many $ sepPipe *> cell
1388 -- surrounding pipes needed for a one-column table:
1387 -- surrounding pipes needed for a one-column table:
1389− guard $ not (null rest && not openPipe)
1388+ guard $ not (length cells == 1 && not openPipe)
1390 optional (char '|')
1389 optional (char '|')
1391 blankline
1390 blankline
1392− let cells = sequence (first:rest)
1393 return $ do
1391 return $ do
1394− cells' <- cells
1392+ cells' <- sequence cells
1395 return $ map
1393 return $ map
1396 (\ils ->
1394 (\ils ->
1397 case trimInlines ils of
1395 case trimInlines ils of