diff options
author | Yan Pas <yanp.bugz@gmail.com> | 2018-10-07 17:53:14 +0300 |
---|---|---|
committer | Yan Pas <yanp.bugz@gmail.com> | 2018-10-07 17:53:14 +0300 |
commit | 4f3dd3b1af7217214287ab886147c5e33a54774d (patch) | |
tree | 705aa3cf5d6d1f0fbd42430c2307d5a07f63b0db /src/Text/Pandoc/Readers | |
parent | c2ae72aa6cee5aebb85228b5cc6fe6a620cf42f7 (diff) | |
download | pandoc-4f3dd3b1af7217214287ab886147c5e33a54774d.tar.gz |
position calculations
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Man.hs | 10 |
1 files changed, 5 insertions, 5 deletions
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) |