diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-26 08:39:45 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-26 08:39:45 -0700 |
commit | 1847335b1dbb2ec92e0accabbf340979db3e7697 (patch) | |
tree | 0fb0aa3f84c64486ca7096608d03faee291b8df3 /src | |
parent | 8899f8838e8c3fac266becc02984693a6229779b (diff) | |
download | pandoc-1847335b1dbb2ec92e0accabbf340979db3e7697.tar.gz |
Groff tokenizer: Allow line comments between table rows.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Groff.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Groff.hs b/src/Text/Pandoc/Readers/Groff.hs index fbe475b96..a752c6445 100644 --- a/src/Text/Pandoc/Readers/Groff.hs +++ b/src/Text/Pandoc/Readers/Groff.hs @@ -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] |