aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index 6f3a1a78d..e0440ec61 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -34,6 +34,7 @@ Conversion of man to 'Pandoc' document.
module Text.Pandoc.Readers.Man (readMan) where
import Prelude
+import Safe (lastMay)
import Data.Char (toLower)
import Data.Default (Default)
import Control.Monad (liftM, mzero, guard)
@@ -114,8 +115,8 @@ parseTable = do
let isMTable (MTable{}) = True
isMTable _ = False
MTable _opts aligns rows pos <- msatisfy isMTable
- case aligns of
- [as] -> try (do
+ case lastMay aligns of
+ Just as -> try (do
let as' = map (columnTypeToAlignment . columnType) as
guard $ all isJust as'
let alignments = catMaybes as'
@@ -128,7 +129,7 @@ parseTable = do
bodyRows <- mapM (mapM parseTableCell) bodyRows'
return $ B.table mempty (zip alignments (repeat 0.0))
headerRow bodyRows) <|> fallback pos
- _ -> fallback pos
+ Nothing -> fallback pos
where