git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: output tables with one column as grid tables
commit40796972812fe7a29d04eb430bee704383736221 authorAlexander Krotov <ilabdsf@gmail.com> dateTue 13 Nov 2018, 18:43 (8 years ago) parent4a950fe
2 files changed+13−1
src/Text/Pandoc/Writers/Muse.hs+1−1 test/Tests/Writers/Muse.hs+12
src/Text/Pandoc/Writers/Muse.hs+1−1
@@ -281,7 +281,7 @@ blockToMuse (Header level (ident,_,_) inlines) = do
281281-- https://www.gnu.org/software/emacs-muse/manual/muse.html#Horizontal-Rules-and-Anchors
282282blockToMuse HorizontalRule = return $ blankline $$ "----" $$ blankline
283283blockToMuse (Table caption aligns widths headers rows) =
284− if all (== 0.0) widths
284+ if all (== 0.0) widths && length widths > 1
285285 then simpleTable caption headers rows
286286 else do
287287 opts <- asks envOptions
test/Tests/Writers/Muse.hs+12
@@ -400,6 +400,18 @@ tests = [ testGroup "block elements"
400400 , " Para 2.1 | Para 2.2"
401401 , " |+ Table 1 +|"
402402 ]
403+ , "table with one column" =:
404+ let headers = []
405+ rows = [[para "Para 1"]
406+ ,[para "Para 2"]]
407+ in simpleTable headers rows
408+ =?>
409+ unlines [ "+--------+"
410+ , "| Para 1 |"
411+ , "+--------+"
412+ , "| Para 2 |"
413+ , "+--------+"
414+ ]
403415 ]
404416 , "div with bullet list" =:
405417 divWith nullAttr (bulletList [para "foo"]) =?>