diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Odt/ContentReader.hs | 11 | ||||
-rw-r--r-- | tests/odt/native/simpleTable.native | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs index 42f018157..8093cc779 100644 --- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs +++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs @@ -695,7 +695,7 @@ read_citation = matchingElement NsText "bibliography-mark" ( findAttrWithDefault NsText "identifier" "" ) ( readAttrWithDefault NsText "number" 0 ) ) - ( matchChildContent [] read_plain_text ) + ( matchChildContent [] read_plain_text ) where makeCitation :: String -> Int -> [Citation] makeCitation citeId num = [Citation citeId [] [] NormalCitation num 0] @@ -708,10 +708,17 @@ read_citation = matchingElement NsText "bibliography-mark" -- read_table :: BlockMatcher read_table = matchingElement NsTable "table" - $ liftA (simpleTable []) + $ liftA simpleTable' $ matchChildContent' [ read_table_row ] +-- | A simple table without a caption or headers +-- | Infers the number of headers from rows +simpleTable' :: [[Blocks]] -> Blocks +simpleTable' [] = simpleTable [] [] +simpleTable' (x : rest) = simpleTable (fmap (const defaults) x) (x : rest) + where defaults = fromList [] + -- read_table_row :: ElementMatcher [[Blocks]] read_table_row = matchingElement NsTable "table-row" diff --git a/tests/odt/native/simpleTable.native b/tests/odt/native/simpleTable.native index f94026bd5..0a9b380a5 100644 --- a/tests/odt/native/simpleTable.native +++ b/tests/odt/native/simpleTable.native @@ -1 +1 @@ -[Table [] [] [] [] [[[Plain [Str "Content"]],[Plain [Str "More",Space,Str "content"]]]],Para []]
\ No newline at end of file +[Table [] [AlignDefault,AlignDefault] [0.0,0.0] [[],[]] [[[Plain [Str "Content"]],[Plain [Str "More",Space,Str "content"]]]],Para []] |