From a35af5db295b0e0c598b1ff68f52fc14a4d3911e Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 13 Mar 2010 03:19:19 +0000 Subject: OpenDocument writer: handle tables with no headers. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1882 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/OpenDocument.hs | 4 +- tests/tables.opendocument | 84 +++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index f057cf1cd..e3ed913d4 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -313,7 +313,9 @@ blockToOpenDocument o bs captionDoc <- if null c then return empty else withParagraphStyle o "Caption" [Para c] - th <- colHeadsToOpenDocument o name (map fst paraHStyles) h + th <- if all null h + then return empty + else colHeadsToOpenDocument o name (map fst paraHStyles) h tr <- mapM (tableRowToOpenDocument o name (map fst paraStyles)) r return $ inTags True "table:table" [ ("table:name" , name) , ("table:style-name", name) diff --git a/tests/tables.opendocument b/tests/tables.opendocument index 872890b48..6cbfa00eb 100644 --- a/tests/tables.opendocument +++ b/tests/tables.opendocument @@ -298,3 +298,87 @@ +Table without column headers: + + + + + + + + 12 + + + 12 + + + 12 + + + 12 + + + + + 123 + + + 123 + + + 123 + + + 123 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + +Multiline table without column headers: + + + + + + + + First + + + row + + + 12.0 + + + Example of a row that spans multiple lines. + + + + + Second + + + row + + + 5.0 + + + Here's another one. Note the blank line between rows. + + + -- cgit v1.2.1