git.iko.soy/typeable/pandoc
on master help sign in
Man reader: allow empty simple table cells.
commit23ca15e7ad28010d98c3c1fc6b850271b62e9dc2 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 25 Oct 2018, 22:53 (8 years ago) parent1ee594b
2 files changed+5−3
src/Text/Pandoc/Readers/Groff.hs+1−1 src/Text/Pandoc/Readers/Man.hs+4−2
src/Text/Pandoc/Readers/Groff.hs+1−1
@@ -356,7 +356,7 @@ tableCell = (enclosedCell <|> simpleCell) >>= lexGroff . T.pack
356356 manyTill anyChar (try (string "T}"))
357357 simpleCell = do
358358 tabChar <- tableTabChar <$> getState
359− many1 (notFollowedBy (char tabChar <|> newline) >> anyChar)
359+ many (notFollowedBy (char tabChar <|> newline) >> anyChar)
360360
361361tableRow :: PandocMonad m => GroffLexer m [GroffTokens]
362362tableRow = do
src/Text/Pandoc/Readers/Man.hs+4−2
@@ -136,10 +136,12 @@ parseTable = do
136136 parseTableCell ts = do
137137 st <- getState
138138 let ts' = Foldable.toList $ unGroffTokens ts
139− let tcell = do
139+ let tcell = try $ do
140140 skipMany memptyLine
141141 plain . trimInlines <$> (parseInlines <* eof)
142− res <- lift $ readWithMTokens tcell st ts'
142+ res <- if null ts'
143+ then return $ Right mempty
144+ else lift $ readWithMTokens tcell st ts'
143145 case res of
144146 Left e -> throwError e
145147 Right x -> return x