summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMauro Bieg <mb21@users.noreply.github.com>2016-10-23 21:42:33 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-10-23 21:42:33 +0200
commit9dd18ebf34ce14a900c947c2f039fb2aec51e6fc (patch)
treedecb4d5d832114355d9054f879f2b1ccd4d78bf2 /src
parent1d15f0e10f1fca7a9127052d8a8d9d905175ebc1 (diff)
ICML writer: replace partial function (!!) in table handling (#3175)
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/ICML.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs
index 8f6123e20..125deb08c 100644
--- a/src/Text/Pandoc/Writers/ICML.hs
+++ b/src/Text/Pandoc/Writers/ICML.hs
@@ -323,13 +323,13 @@ blockToICML opts style (Table caption aligns widths headers rows) =
else length $ head rows
rowsToICML [] _ = return empty
rowsToICML (col:rest) rowNr =
- liftM2 ($$) (colsToICML col rowNr (0::Int)) $ rowsToICML rest (rowNr+1)
- colsToICML [] _ _ = return empty
- colsToICML (cell:rest) rowNr colNr = do
+ liftM2 ($$) (colsToICML col aligns rowNr (0::Int)) $ rowsToICML rest (rowNr+1)
+ colsToICML [] _ _ _ = return empty
+ colsToICML _ [] _ _ = return empty
+ colsToICML (cell:rest) (alig:restAligns) rowNr colNr = do
let stl = if rowNr == 0 && not noHeader
then tableHeaderName:style'
else style'
- alig = aligns !! colNr
stl' | alig == AlignLeft = alignLeftName : stl
| alig == AlignRight = alignRightName : stl
| alig == AlignCenter = alignCenterName : stl
@@ -337,7 +337,7 @@ blockToICML opts style (Table caption aligns widths headers rows) =
c <- blocksToICML opts stl' cell
let cl = return $ inTags True "Cell"
[("Name", show colNr ++":"++ show rowNr), ("AppliedCellStyle","CellStyle/Cell")] c
- liftM2 ($$) cl $ colsToICML rest rowNr (colNr+1)
+ liftM2 ($$) cl $ colsToICML rest restAligns rowNr (colNr+1)
in do
let tabl = if noHeader
then rows