@@ -311,6 +311,7 @@ lexComment = do
311311lexMacro :: PandocMonad m => RoffLexer m RoffTokens
312312lexMacro = do
313313 pos <- getPosition
314+ guard $ sourceColumn pos == 1
314315 char '.' <|> char '\''
315316 skipMany spacetab
316317 macroName <- many (satisfy (not . isSpace))
@@ -369,7 +370,9 @@ lexTableRows = do
369370 return $ zip aligns rows
370371
371372tableCell :: PandocMonad m => RoffLexer m RoffTokens
372−tableCell = (enclosedCell <|> simpleCell) >>= lexRoff . T.pack
373+tableCell = do
374+ pos <- getPosition
375+ (enclosedCell <|> simpleCell) >>= lexRoff pos . T.pack
373376 where
374377 enclosedCell = do
375378 try (string "T{")
@@ -642,9 +645,10 @@ linePartsToString = mconcat . map go
642645 go _ = mempty
643646
644647-- | Tokenize a string as a sequence of groff tokens.
645−lexRoff :: PandocMonad m => T.Text -> m RoffTokens
646−lexRoff txt = do
647− eithertokens <- readWithM (mconcat <$> many manToken) def (T.unpack txt)
648+lexRoff :: PandocMonad m => SourcePos -> T.Text -> m RoffTokens
649+lexRoff pos txt = do
650+ eithertokens <- readWithM (do setPosition pos
651+ mconcat <$> many manToken) def (T.unpack txt)
648652 case eithertokens of
649653 Left e -> throwError e
650654 Right tokenz -> return tokenz