Groff tokenizer: Allow line comments between table rows.

This commit is contained in:
John MacFarlane 2018-10-26 08:39:45 -07:00
parent 8899f8838e
commit 1847335b1d

View file

@ -337,14 +337,19 @@ lexMacro = do
lexTable :: PandocMonad m => SourcePos -> GroffLexer m GroffTokens
lexTable pos = do
skipMany lexComment
spaces
opts <- option [] tableOptions
case lookup "tab" opts of
Just (c:_) -> modifyState $ \st -> st{ tableTabChar = c }
_ -> modifyState $ \st -> st{ tableTabChar = '\t' }
spaces
skipMany lexComment
spaces
aligns <- tableFormatSpec
spaces
skipMany lexComment
spaces
rows <- manyTill tableRow (try (string ".TE" >> skipMany spacetab >> eofline))
return $ singleTok $ MTable opts aligns rows pos
@ -365,6 +370,7 @@ tableRow = do
cs <- many $ try (char tabChar >> tableCell)
skipMany spacetab
eofline
skipMany lexComment
return (c:cs)
tableOptions :: PandocMonad m => GroffLexer m [TableOption]