aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-27 10:24:06 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-27 10:24:06 -0700
commit0baaa1080a5e937bf8b3c301fbe5db08145b58b4 (patch)
treeb3cf368684b2e2bd9545b82dbf3bdf93d2572e2d /src
parent2a4dbc3dce037d16a65d569ada6be2fb05240e4e (diff)
downloadpandoc-0baaa1080a5e937bf8b3c301fbe5db08145b58b4.tar.gz
Pipe tables: allow indented columns.
Previously the left-hand column could not start with 4 or more spaces indent. This was inconvenient for right-aligned left columns. Note that the first (header column) must still have 3 or fewer spaces indentation, or the table will be treated as an indented code block.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index ae81ae7fc..80a13b3bd 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1333,6 +1333,8 @@ pipeBreak = try $ do
pipeTable :: MarkdownParser ([Alignment], [Double], F [Blocks], F [[Blocks]])
pipeTable = try $ do
+ nonindentSpaces
+ lookAhead nonspaceChar
(heads,aligns) <- (,) <$> pipeTableRow <*> pipeBreak
lines' <- sequence <$> many pipeTableRow
let widths = replicate (length aligns) 0.0
@@ -1346,7 +1348,7 @@ sepPipe = try $ do
-- parse a row, also returning probable alignments for org-table cells
pipeTableRow :: MarkdownParser (F [Blocks])
pipeTableRow = do
- nonindentSpaces
+ skipMany spaceChar
openPipe <- (True <$ char '|') <|> return False
let cell = mconcat <$>
many (notFollowedBy (blankline <|> char '|') >> inline)