aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Odt/ContentReader.hs11
1 files changed, 9 insertions, 2 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"