Groff tokenizer: Allow line comments between table rows.
This commit is contained in:
parent
8899f8838e
commit
1847335b1d
1 changed files with 6 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue