diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 90d2bde1a..6a2eedfaf 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -10,7 +10,7 @@ import Data.Monoid import Data.Char (isSpace) import Control.Monad.State import Control.Applicative ((<$>)) -import Data.List (intersperse) +import Data.List (intersperse, transpose) {- @@ -698,14 +698,16 @@ parseBlock (Elem e) = Just "right" -> AlignRight Just "center" -> AlignCenter _ -> AlignDefault + let numrows = maximum $ map length bodyrows let aligns = case colspecs of - [] -> replicate - (maximum $ map length bodyrows) - AlignDefault + [] -> replicate numrows AlignDefault cs -> map toAlignment cs + let headrows' = if null headrows + then replicate numrows mempty + else headrows return $ table caption (zip aligns (repeat 0)) - headrows bodyrows + headrows' bodyrows isEntry x = named "entry" x || named "td" x || named "th" x parseRow = mapM getBlocks . filterChildren isEntry sect n = do isbook <- gets dbBook |