From 1847335b1dbb2ec92e0accabbf340979db3e7697 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Fri, 26 Oct 2018 08:39:45 -0700
Subject: [PATCH] Groff tokenizer: Allow line comments between table rows.

---
 src/Text/Pandoc/Readers/Groff.hs | 6 ++++++
 1 file changed, 6 insertions(+)

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]