aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-01-07 23:39:49 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-01-07 23:39:49 -0800
commitd9eff99f27bb6426534651c9ff85b2b4354e6d16 (patch)
tree51d9ba15ae88a1773a25032fb4df186107dd6961 /src/Text
parent3cad665afb4e8838d3fb26cc445b548197f01563 (diff)
downloadpandoc-d9eff99f27bb6426534651c9ff85b2b4354e6d16.tar.gz
Markdown reader: Allow hard line breaks in table cells.
The \-newline form must be used; the two-space+newline form won't work, since in a table cell nearly every line ends with two spaces.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 3a5d29b4e..88d0bf439 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1126,12 +1126,12 @@ multilineTableHeader headless = try $ do
then liftM (map (:[]) . tail .
splitStringByIndices (init indices)) $ lookAhead anyLine
else return $ transpose $ map
- (\ln -> tail $ splitStringByIndices (init indices) ln)
+ (tail . splitStringByIndices (init indices))
rawContent
let aligns = zipWith alignType rawHeadsList lengths
let rawHeads = if headless
then replicate (length dashes) ""
- else map unwords rawHeadsList
+ else map (unlines . map trim) rawHeadsList
heads <- fmap sequence $
mapM (parseFromString (mconcat <$> many plain)) $
map trim rawHeads
@@ -1188,7 +1188,7 @@ gridTableHeader headless = try $ do
-- RST does not have a notion of alignments
let rawHeads = if headless
then replicate (length dashes) ""
- else map unwords $ transpose
+ else map (unlines . map trim) $ transpose
$ map (gridTableSplitLine indices) rawContent
heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads
return (heads, aligns, indices)