git.iko.soy/typeable/pandoc
on master help sign in
Hlint changes.
commitfdce771a4e56c5763c449cf41fbee33b69a11541 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 28 Oct 2018, 10:46 (8 years ago) parentfe73707
2 files changed+9−10
src/Text/Pandoc/Readers/Man.hs+5−6 src/Text/Pandoc/Readers/Roff.hs+4−4
src/Text/Pandoc/Readers/Man.hs+5−6
@@ -1,5 +1,5 @@
11{-# LANGUAGE FlexibleContexts #-}
2−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2+
33{-
44 Copyright (C) 2018 Yan Pashkovsky <yanp.bugz@gmail.com>
55 and John MacFarlane
@@ -224,7 +224,7 @@ mmacro mk = msatisfy isMMacro where
224224
225225mmacroAny :: PandocMonad m => ManParser m RoffToken
226226mmacroAny = msatisfy isMMacro where
227− isMMacro (MMacro{}) = True
227+ isMMacro MMacro{} = True
228228 isMMacro _ = False
229229
230230--
@@ -387,8 +387,8 @@ parseCodeBlock = try $ do
387387 | not (null ss)
388388 , all isFontToken ss = Nothing
389389 | otherwise = Just $ linePartsToString ss
390− where isFontToken (FontSize{}) = True
391− isFontToken (Font{}) = True
390+ where isFontToken FontSize{} = True
391+ isFontToken Font{} = True
392392 isFontToken _ = False
393393 extractText MEmptyLine = Just ""
394394 -- string are intercalated with '\n', this prevents double '\n'
@@ -456,8 +456,7 @@ definitionListItem = try $ do
456456 term <- parseInline
457457 moreterms <- many $ try $ do
458458 mmacro "TQ"
459− newterm <- parseInline
460− return newterm
459+ parseInline
461460 inls <- option mempty parseInlines
462461 continuations <- mconcat <$> many continuation
463462 return ( mconcat (intersperse B.linebreak (term:moreterms))
src/Text/Pandoc/Readers/Roff.hs+4−4
@@ -247,7 +247,7 @@ escape = do
247247-- \s-1 \s0
248248escFontSize :: PandocMonad m => RoffLexer m [LinePart]
249249escFontSize = do
250− let sign = option "" $ ("-" <$ char '-' <|> "" <$ char '+')
250+ let sign = option "" ("-" <$ char '-' <|> "" <$ char '+')
251251 let toFontSize xs =
252252 case safeRead xs of
253253 Nothing -> mzero
@@ -420,10 +420,10 @@ tableFormatSpecLine =
420420tableColFormat :: PandocMonad m => RoffLexer m CellFormat
421421tableColFormat = do
422422 pipePrefix' <- option False
423− $ True <$ (try $ string "|" <* notFollowedBy spacetab)
423+ $ True <$ try (string "|" <* notFollowedBy spacetab)
424424 c <- oneOf ['a','A','c','C','l','L','n','N','r','R','s','S','^','_','-',
425425 '=','|']
426− suffixes <- many $ (try $ skipMany spacetab *> count 1 digit) <|>
426+ suffixes <- many $ try (skipMany spacetab *> count 1 digit) <|>
427427 (do x <- oneOf ['b','B','d','D','e','E','f','F','i','I','m','M',
428428 'p','P','t','T','u','U','v','V','w','W','x','X', 'z','Z']
429429 num <- case toLower x of
@@ -441,7 +441,7 @@ tableColFormat = do
441441 , pipePrefix = pipePrefix'
442442 , pipeSuffix = pipeSuffix'
443443 , columnSuffixes = suffixes }
444−
444+
445445-- We don't fully handle the conditional. But we do
446446-- include everything under '.ie n', which occurs commonly
447447-- in man pages. We always skip the '.el' part.