git.iko.soy/typeable/pandoc
on master help sign in
Markdown: Allow pipe tables created by emacs orgtbl-mode to work.

The difference is the + separators. Note: only simple org-tables work, with no bottom line. This just allows you to use org-mode's nice table editor to create regular pipe tables. In particular, org-mode's method for determining column alignments implicitly is not enabled. You must put in :s to specify alignments, as stated in the documentation.

commit3a17919a46ea17f82ca4d694c22a78c61bbf1e4a authorJohn MacFarlane <jgm@berkeley.edu> dateFri 10 Aug 2012, 13:29 (14 years ago) parent5a2e601
1 file changed+8−4
src/Text/Pandoc/Readers/Markdown.hs+8−4
src/Text/Pandoc/Readers/Markdown.hs+8−4
@@ -993,27 +993,31 @@ pipeTable = try $ do
993993 (heads,aligns) <- try ( pipeBreak >>= \als ->
994994 return (return $ replicate (length als) mempty, als))
995995 <|> ( pipeTableRow >>= \row -> pipeBreak >>= \als ->
996+
996997 return (row, als) )
997− lines' <- fmap sequence $ many1 pipeTableRow
998+ lines' <- sequence <$> many1 pipeTableRow
998999 blanklines
9991000 let widths = replicate (length aligns) 0.0
10001001 return $ (aligns, widths, heads, lines')
10011002
10021003sepPipe :: Parser [Char] ParserState ()
1003−sepPipe = try $ char '|' >> notFollowedBy blankline
1004+sepPipe = try $ do
1005+ char '|' <|> char '+'
1006+ notFollowedBy blankline
10041007
1008+-- parse a row, also returning probable alignments for org-table cells
10051009pipeTableRow :: Parser [Char] ParserState (F [Blocks])
10061010pipeTableRow = do
10071011 nonindentSpaces
10081012 optional (char '|')
10091013 let cell = mconcat <$>
1010− many (notFollowedBy (blankline <|> char '|') >> inline)
1014+ many (notFollowedBy (blankline <|> char '|') >> inline)
10111015 first <- cell
10121016 sepPipe
10131017 rest <- cell `sepBy1` sepPipe
10141018 optional (char '|')
10151019 blankline
1016− let cells = sequence (first:rest)
1020+ let cells = sequence (first:rest)
10171021 return $ do
10181022 cells' <- cells
10191023 return $ map