Man reader: Add placeholder for table token.

This commit is contained in:
John MacFarlane 2018-10-23 23:35:37 -07:00
parent 8efb8975ed
commit 55068c4cae

View file

@ -83,6 +83,7 @@ type Arg = [LinePart]
data ManToken = MLine [LinePart]
| MEmptyLine
| MMacro MacroKind [Arg] SourcePos
| MTable [Alignment] ManTokens [ManTokens] [[ManTokens]]
deriving Show
newtype ManTokens = ManTokens { unManTokens :: Seq.Seq ManToken }
@ -309,6 +310,7 @@ lexMacro = do
"ie" -> lexConditional
"if" -> lexConditional
"el" -> skipConditional
"TS" -> lexTable
_ -> do
args <- lexArgs
@ -324,6 +326,14 @@ lexMacro = do
"so" -> lexIncludeFile args
_ -> resolveMacro macroName args pos
-- | TODO placeholder
lexTable :: PandocMonad m => ManLexer m ManTokens
lexTable = do
pos <- getPosition
manyTill anyLine (try (string ".TE" >> many spacetab >> eofline))
report $ SkippedContent "table" pos
return mempty
-- We don't fully handle the conditional. But we do
-- include everything under '.ie n', which occurs commonly
-- in man pages. We always skip the '.el' part.