diff options
| author | John MacFarlane <[email protected]> | 2024-07-03 15:45:07 -0600 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-07-03 15:45:07 -0600 |
| commit | e594cea9ca787002411a216b5fcfc5ea0eafb662 (patch) | |
| tree | e4cca82348dc3cd6de3e09db1dfc74e4ca165736 /src/Text | |
| parent | c723014d94f6a4a76bbf05b6778f1f71afaa6c2f (diff) | |
TWiki reader: avoid partial function.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Readers/TWiki.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/TWiki.hs b/src/Text/Pandoc/Readers/TWiki.hs index 0fb54120b..07b9d8393 100644 --- a/src/Text/Pandoc/Readers/TWiki.hs +++ b/src/Text/Pandoc/Readers/TWiki.hs @@ -222,9 +222,11 @@ table = try $ do (TableHead nullAttr $ toHeaderRow heads) [TableBody nullAttr 0 [] $ map toRow rows] (TableFoot nullAttr []) - align rows = replicate (columCount rows) (AlignDefault, ColWidthDefault) - columns rows = replicate (columCount rows) mempty - columCount rows = length $ head rows + align rows = replicate (columnCount rows) + (AlignDefault, ColWidthDefault) + columns rows = replicate (columnCount rows) mempty + columnCount (r:_) = length r + columnCount [] = 0 toRow = Row nullAttr . map B.simpleCell toHeaderRow l = [toRow l | not (null l)] |
