From 4f3dd3b1af7217214287ab886147c5e33a54774d Mon Sep 17 00:00:00 2001 From: Yan Pas Date: Sun, 7 Oct 2018 17:53:14 +0300 Subject: position calculations --- src/Text/Pandoc/Readers/Man.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index adac1aca8..30076102b 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -225,9 +225,9 @@ lexMacro = do macroName <- many1 (letter <|> oneOf ['\\', '"']) args <- lexArgs let joinedArgs = unwords $ fst <$> args - let knownMacro mkind = MMacro mkind args + knownMacro mkind = MMacro mkind args - let tok = case macroName of + tok = case macroName of x | x `elem` ["\\\"", "\\#"] -> MComment joinedArgs "TH" -> knownMacro KTitle "IP" -> knownMacro KTab @@ -320,7 +320,7 @@ msatisfy :: (Show t, Stream s m t) => (t -> Bool) -> ParserT s st m t msatisfy predic = tokenPrim show nextPos testTok where testTok t = if predic t then Just t else Nothing - nextPos pos x _xs = updatePosString (setSourceLine pos $ sourceLine pos + (if predic x then 1 else 0)) (show x) + nextPos pos _x _xs = updatePosString (setSourceColumn (setSourceLine pos $ sourceLine pos + 1) 1) ("") mstr :: PandocMonad m => ManParser m ManToken mstr = msatisfy isMStr where @@ -509,9 +509,9 @@ parseList = do paras = do (MMacro _ args) <- mmacro KTab let lbuilderOpt = listKind args - let lbuilder = fromMaybe BulletList lbuilderOpt + lbuilder = fromMaybe BulletList lbuilderOpt + macroinl = macroIPInl args inls <- parseInlines - let macroinl = macroIPInl args let parainls = if isNothing lbuilderOpt then macroinl ++ inls else inls subls <- many sublist return $ (lbuilder, (Plain parainls) : subls) -- cgit v1.2.3