git.iko.soy/typeable/pandoc
on master help sign in
Hlint changes.
fdce771John MacFarlane
src/Text/Pandoc/Readers/Man.hs+5−6
@@ -1,5 +1,5 @@
1{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
2−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2+
3{-
3{-
4 Copyright (C) 2018 Yan Pashkovsky <yanp.bugz@gmail.com>
4 Copyright (C) 2018 Yan Pashkovsky <yanp.bugz@gmail.com>
5 and John MacFarlane
5 and John MacFarlane
@@ -224,7 +224,7 @@ mmacro mk = msatisfy isMMacro where
224
224
225mmacroAny :: PandocMonad m => ManParser m RoffToken
225mmacroAny :: PandocMonad m => ManParser m RoffToken
226mmacroAny = msatisfy isMMacro where
226mmacroAny = msatisfy isMMacro where
227− isMMacro (MMacro{}) = True
227+ isMMacro MMacro{} = True
228 isMMacro _ = False
228 isMMacro _ = False
229
229
230--
230--
@@ -387,8 +387,8 @@ parseCodeBlock = try $ do
387 | not (null ss)
387 | not (null ss)
388 , all isFontToken ss = Nothing
388 , all isFontToken ss = Nothing
389 | otherwise = Just $ linePartsToString ss
389 | otherwise = Just $ linePartsToString ss
390− where isFontToken (FontSize{}) = True
390+ where isFontToken FontSize{} = True
391− isFontToken (Font{}) = True
391+ isFontToken Font{} = True
392 isFontToken _ = False
392 isFontToken _ = False
393 extractText MEmptyLine = Just ""
393 extractText MEmptyLine = Just ""
394 -- string are intercalated with '\n', this prevents double '\n'
394 -- string are intercalated with '\n', this prevents double '\n'
@@ -456,8 +456,7 @@ definitionListItem = try $ do
456 term <- parseInline
456 term <- parseInline
457 moreterms <- many $ try $ do
457 moreterms <- many $ try $ do
458 mmacro "TQ"
458 mmacro "TQ"
459− newterm <- parseInline
459+ parseInline
460− return newterm
461 inls <- option mempty parseInlines
460 inls <- option mempty parseInlines
462 continuations <- mconcat <$> many continuation
461 continuations <- mconcat <$> many continuation
463 return ( mconcat (intersperse B.linebreak (term:moreterms))
462 return ( mconcat (intersperse B.linebreak (term:moreterms))
src/Text/Pandoc/Readers/Roff.hs+4−4
@@ -247,7 +247,7 @@ escape = do
247-- \s-1 \s0
247-- \s-1 \s0
248escFontSize :: PandocMonad m => RoffLexer m [LinePart]
248escFontSize :: PandocMonad m => RoffLexer m [LinePart]
249escFontSize = do
249escFontSize = do
250− let sign = option "" $ ("-" <$ char '-' <|> "" <$ char '+')
250+ let sign = option "" ("-" <$ char '-' <|> "" <$ char '+')
251 let toFontSize xs =
251 let toFontSize xs =
252 case safeRead xs of
252 case safeRead xs of
253 Nothing -> mzero
253 Nothing -> mzero
@@ -420,10 +420,10 @@ tableFormatSpecLine =
420tableColFormat :: PandocMonad m => RoffLexer m CellFormat
420tableColFormat :: PandocMonad m => RoffLexer m CellFormat
421tableColFormat = do
421tableColFormat = do
422 pipePrefix' <- option False
422 pipePrefix' <- option False
423− $ True <$ (try $ string "|" <* notFollowedBy spacetab)
423+ $ True <$ try (string "|" <* notFollowedBy spacetab)
424 c <- oneOf ['a','A','c','C','l','L','n','N','r','R','s','S','^','_','-',
424 c <- oneOf ['a','A','c','C','l','L','n','N','r','R','s','S','^','_','-',
425 '=','|']
425 '=','|']
426− suffixes <- many $ (try $ skipMany spacetab *> count 1 digit) <|>
426+ suffixes <- many $ try (skipMany spacetab *> count 1 digit) <|>
427 (do x <- oneOf ['b','B','d','D','e','E','f','F','i','I','m','M',
427 (do x <- oneOf ['b','B','d','D','e','E','f','F','i','I','m','M',
428 'p','P','t','T','u','U','v','V','w','W','x','X', 'z','Z']
428 'p','P','t','T','u','U','v','V','w','W','x','X', 'z','Z']
429 num <- case toLower x of
429 num <- case toLower x of
@@ -441,7 +441,7 @@ tableColFormat = do
441 , pipePrefix = pipePrefix'
441 , pipePrefix = pipePrefix'
442 , pipeSuffix = pipeSuffix'
442 , pipeSuffix = pipeSuffix'
443 , columnSuffixes = suffixes }
443 , columnSuffixes = suffixes }
444−
444+
445-- We don't fully handle the conditional. But we do
445-- We don't fully handle the conditional. But we do
446-- include everything under '.ie n', which occurs commonly
446-- include everything under '.ie n', which occurs commonly
447-- in man pages. We always skip the '.el' part.
447-- in man pages. We always skip the '.el' part.