git.iko.soy/typeable/pandoc
on master help sign in
Groff tokenizer: Allow line comments between table rows.
commit1847335b1dbb2ec92e0accabbf340979db3e7697 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 26 Oct 2018, 08:39 (8 years ago) parent8899f88
1 file changed+6
src/Text/Pandoc/Readers/Groff.hs+6
src/Text/Pandoc/Readers/Groff.hs+6
@@ -337,14 +337,19 @@ lexMacro = do
337337
338338lexTable :: PandocMonad m => SourcePos -> GroffLexer m GroffTokens
339339lexTable pos = do
340+ skipMany lexComment
340341 spaces
341342 opts <- option [] tableOptions
342343 case lookup "tab" opts of
343344 Just (c:_) -> modifyState $ \st -> st{ tableTabChar = c }
344345 _ -> modifyState $ \st -> st{ tableTabChar = '\t' }
345346 spaces
347+ skipMany lexComment
348+ spaces
346349 aligns <- tableFormatSpec
347350 spaces
351+ skipMany lexComment
352+ spaces
348353 rows <- manyTill tableRow (try (string ".TE" >> skipMany spacetab >> eofline))
349354 return $ singleTok $ MTable opts aligns rows pos
350355
@@ -365,6 +370,7 @@ tableRow = do
365370 cs <- many $ try (char tabChar >> tableCell)
366371 skipMany spacetab
367372 eofline
373+ skipMany lexComment
368374 return (c:cs)
369375
370376tableOptions :: PandocMonad m => GroffLexer m [TableOption]