git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: allow `+` separators in pipe table cells.

We already allowed them in the header, but not in the body rows, for some reason. This gives compatibility with org-mode tables.

commit6e950a8eb5001314869013395c9c72ee05079110 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 9 Mar 2016, 08:44 (11 years ago) parent4ed6483
1 file changed+4−6
src/Text/Pandoc/Readers/Markdown.hs+4−6
src/Text/Pandoc/Readers/Markdown.hs+4−6
@@ -1382,16 +1382,14 @@ pipeTableRow' = do
13821382 skipMany spaceChar
13831383 openPipe <- (True <$ char '|') <|> return False
13841384 let cell = mconcat <$>
1385− many (notFollowedBy (blankline <|> char '|') >> inline)
1386− first <- cell
1387− rest <- many $ sepPipe *> cell
1385+ many (notFollowedBy (blankline <|> oneOf "+|") >> inline)
1386+ cells <- cell `sepBy1` sepPipe
13881387 -- surrounding pipes needed for a one-column table:
1389− guard $ not (null rest && not openPipe)
1388+ guard $ not (length cells == 1 && not openPipe)
13901389 optional (char '|')
13911390 blankline
1392− let cells = sequence (first:rest)
13931391 return $ do
1394− cells' <- cells
1392+ cells' <- sequence cells
13951393 return $ map
13961394 (\ils ->
13971395 case trimInlines ils of