diff options
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 6 | ||||
-rw-r--r-- | tests/tables.markdown | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index a62988b20..66f0acc59 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -196,11 +196,11 @@ blockToMarkdown opts (Table caption aligns widths headers rows) = do let tableWidth = sum widthsInChars let maxRowHeight = maximum $ map heightOfBlock (head:rows') let isMultilineTable = maxRowHeight > 1 - let border = if isMultilineTable - then text $ replicate tableWidth '-' - else empty let underline = hsep $ map (\width -> text $ replicate width '-') widthsInChars + let border = if isMultilineTable + then text $ replicate (sum widthsInChars + (length widthsInChars - 1)) '-' + else empty let spacer = if isMultilineTable then text "" else empty diff --git a/tests/tables.markdown b/tests/tables.markdown index 0251c3149..60389ea94 100644 --- a/tests/tables.markdown +++ b/tests/tables.markdown @@ -28,7 +28,7 @@ Simple table indented two spaces: Multiline table with caption: - ----------------------------------------------------------- + -------------------------------------------------------------- Centered Left Right Default aligned Header Aligned Aligned ----------- ---------- ------------ -------------------------- @@ -38,13 +38,13 @@ Multiline table with caption: Second row 5.0 Here's another one. Note the blank line between rows. - ----------------------------------------------------------- + -------------------------------------------------------------- Table: Here's the caption. It may span multiple lines. Multiline table without caption: - ----------------------------------------------------------- + -------------------------------------------------------------- Centered Left Right Default aligned Header Aligned Aligned ----------- ---------- ------------ -------------------------- @@ -54,7 +54,6 @@ Multiline table without caption: Second row 5.0 Here's another one. Note the blank line between rows. - ----------------------------------------------------------- + -------------------------------------------------------------- - |