diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-11-13 18:43:46 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-11-13 18:44:56 +0300 |
commit | 40796972812fe7a29d04eb430bee704383736221 (patch) | |
tree | a2cfd3cb3a9891a768b6c651f57333f6f5c5ac77 | |
parent | 4a950feb8e6ff0f557af5c686d860dc70ca01f42 (diff) | |
download | pandoc-40796972812fe7a29d04eb430bee704383736221.tar.gz |
Muse writer: output tables with one column as grid tables
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 2 | ||||
-rw-r--r-- | test/Tests/Writers/Muse.hs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 2001c56fd..1d7a3fd77 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -281,7 +281,7 @@ blockToMuse (Header level (ident,_,_) inlines) = do -- https://www.gnu.org/software/emacs-muse/manual/muse.html#Horizontal-Rules-and-Anchors blockToMuse HorizontalRule = return $ blankline $$ "----" $$ blankline blockToMuse (Table caption aligns widths headers rows) = - if all (== 0.0) widths + if all (== 0.0) widths && length widths > 1 then simpleTable caption headers rows else do opts <- asks envOptions diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index c6ebac771..6cf718c0b 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -400,6 +400,18 @@ tests = [ testGroup "block elements" , " Para 2.1 | Para 2.2" , " |+ Table 1 +|" ] + , "table with one column" =: + let headers = [] + rows = [[para "Para 1"] + ,[para "Para 2"]] + in simpleTable headers rows + =?> + unlines [ "+--------+" + , "| Para 1 |" + , "+--------+" + , "| Para 2 |" + , "+--------+" + ] ] , "div with bullet list" =: divWith nullAttr (bulletList [para "foo"]) =?> |