@@ -44,7 +44,7 @@ import Data.Char (isDigit, isSpace)
4444import qualified Data.Foldable as F
4545import Data.List (intercalate, intersperse, isPrefixOf)
4646import qualified Data.Map as M
47−import Data.Maybe (fromMaybe)
47+import Data.Maybe (fromMaybe, maybeToList)
4848import Data.Monoid ((<>))
4949import Data.Sequence (ViewL (..), viewl, (<|))
5050import qualified Data.Set as Set
@@ -239,7 +239,7 @@ table = do
239239 Nothing -> 1.0
240240 caption <- option mempty tableCaption
241241 optional rowsep
242− hasheader <- option False $ True <$ (lookAhead (skipSpaces *> char '!'))
242+ hasheader <- option False $ True <$ lookAhead (skipSpaces *> char '!')
243243 (cellspecs',hdr) <- unzip <$> tableRow
244244 let widths = map ((tableWidth *) . snd) cellspecs'
245245 let restwidth = tableWidth - sum widths
@@ -358,7 +358,7 @@ syntaxhighlight tag attrs = try $ do
358358 let mblang = lookup "lang" attrs
359359 let mbstart = lookup "start" attrs
360360 let mbline = lookup "line" attrs
361− let classes = maybe [] (:[]) mblang ++ maybe [] (const ["numberLines"]) mbline
361+ let classes = maybeToList mblang ++ maybe [] (const ["numberLines"]) mbline
362362 let kvs = maybe [] (\x -> [("startFrom",x)]) mbstart
363363 contents <- charsInTags tag
364364 return $ B.codeBlockWith ("",classes,kvs) $ trimCode contents
@@ -373,7 +373,7 @@ preformatted :: PandocMonad m => MWParser m Blocks
373373preformatted = try $ do
374374 guardColumnOne
375375 char ' '
376− let endline' = B.linebreak <$ (try $ newline <* char ' ')
376+ let endline' = B.linebreak <$ try (newline <* char ' ')
377377 let whitespace' = B.str <$> many1 ('\160' <$ spaceChar)
378378 let spToNbsp ' ' = '\160'
379379 spToNbsp x = x
@@ -382,7 +382,7 @@ preformatted = try $ do
382382 (htmlTag (~== TagOpen "nowiki" []) *>
383383 manyTill anyChar (htmlTag (~== TagClose "nowiki")))
384384 let inline' = whitespace' <|> endline' <|> nowiki'
385− <|> (try $ notFollowedBy newline *> inline)
385+ <|> try (notFollowedBy newline *> inline)
386386 contents <- mconcat <$> many1 inline'
387387 let spacesStr (Str xs) = all isSpace xs
388388 spacesStr _ = False
@@ -397,7 +397,7 @@ encode = B.fromList . normalizeCode . B.toList . walk strToCode
397397 strToCode x = x
398398 normalizeCode [] = []
399399 normalizeCode (Code a1 x : Code a2 y : zs) | a1 == a2 =
400− normalizeCode $ (Code a1 (x ++ y)) : zs
400+ normalizeCode $ Code a1 (x ++ y) : zs
401401 normalizeCode (x:xs) = x : normalizeCode xs
402402
403403header :: PandocMonad m => MWParser m Blocks
@@ -510,8 +510,8 @@ listItem' c = try $ do
510510firstParaToPlain :: Blocks -> Blocks
511511firstParaToPlain contents =
512512 case viewl (B.unMany contents) of
513− (Para xs) :< ys -> B.Many $ (Plain xs) <| ys
514− _ -> contents
513+ Para xs :< ys -> B.Many $ Plain xs <| ys
514+ _ -> contents
515515
516516--
517517-- inline parsers
@@ -612,13 +612,13 @@ image = try $ do
612612 choice imageIdentifiers
613613 fname <- addUnderscores <$> many1 (noneOf "|]")
614614 _ <- many imageOption
615− dims <- try (char '|' *> (sepBy (many digit) (char 'x')) <* string "px")
615+ dims <- try (char '|' *> sepBy (many digit) (char 'x') <* string "px")
616616 <|> return []
617617 _ <- many imageOption
618618 let kvs = case dims of
619− w:[] -> [("width", w)]
620− w:(h:[]) -> [("width", w), ("height", h)]
621− _ -> []
619+ [w] -> [("width", w)]
620+ [w, h] -> [("width", w), ("height", h)]
621+ _ -> []
622622 let attr = ("", [], kvs)
623623 caption <- (B.str fname <$ sym "]]")
624624 <|> try (char '|' *> (mconcat <$> manyTill inline (sym "]]")))
@@ -651,7 +651,7 @@ internalLink = try $ do
651651 ( (mconcat <$> many1 (notFollowedBy (char ']') *> inline))
652652 -- the "pipe trick"
653653 -- [[Help:Contents|] -> "Contents"
654− <|> (return $ B.text $ drop 1 $ dropWhile (/=':') pagename) )
654+ <|> return (B.text $ drop 1 $ dropWhile (/=':') pagename) )
655655 sym "]]"
656656 linktrail <- B.text <$> many letter
657657 let link = B.link (addUnderscores pagename) "wikilink" (label <> linktrail)