git.iko.soy/typeable/pandoc
on master help sign in
hlint Muse reader and tests
commite536c4d9c9c4ff73213dc0273654ea3e1916f22e authorAlexander Krotov <ilabdsf@gmail.com> dateWed 6 Dec 2017, 19:38 (9 years ago) parent6fd3cda
2 files changed+8−8
src/Text/Pandoc/Readers/Muse.hs+4−4 test/Tests/Readers/Muse.hs+4−4
src/Text/Pandoc/Readers/Muse.hs+4−4
@@ -148,7 +148,7 @@ atStart p = do
148148--
149149
150150-- While not documented, Emacs Muse allows "-" in directive name
151−parseDirectiveKey :: PandocMonad m => MuseParser m (String)
151+parseDirectiveKey :: PandocMonad m => MuseParser m String
152152parseDirectiveKey = do
153153 char '#'
154154 many (letter <|> char '-')
@@ -173,7 +173,7 @@ parseAmuseDirective = do
173173 value <- parseFromString (trimInlinesF . mconcat <$> many inline) $ unlines (first : rest)
174174 return (key, value)
175175 where
176− endOfDirective = lookAhead $ endOfInput <|> (try $ void blankline) <|> (try $ void parseDirectiveKey)
176+ endOfDirective = lookAhead $ endOfInput <|> try (void blankline) <|> try (void parseDirectiveKey)
177177 endOfInput = try $ skipMany blankline >> skipSpaces >> eof
178178
179179directive :: PandocMonad m => MuseParser m ()
@@ -428,7 +428,7 @@ listStart marker = try $ do
428428dropSpacePrefix :: [String] -> [String]
429429dropSpacePrefix lns =
430430 map (drop maxIndent) lns
431− where flns = filter (\s -> not $ all (== ' ') s) lns
431+ where flns = filter (not . all (== ' ')) lns
432432 maxIndent = if null flns then 0 else length $ takeWhile (== ' ') $ foldl1 commonPrefix flns
433433
434434listItemContents :: PandocMonad m => Int -> MuseParser m (F Blocks)
@@ -620,7 +620,7 @@ inlineList = [ endline
620620 ]
621621
622622inline :: PandocMonad m => MuseParser m (F Inlines)
623−inline = (choice inlineList) <?> "inline"
623+inline = choice inlineList <?> "inline"
624624
625625endline :: PandocMonad m => MuseParser m (F Inlines)
626626endline = try $ do
test/Tests/Readers/Muse.hs+4−4
@@ -116,7 +116,7 @@ tests =
116116 , "Linebreak" =: "Line <br> break" =?> para ("Line" <> linebreak <> "break")
117117
118118 , test emacsMuse "Non-breaking space"
119− ("Foo~~bar" =?> para ("Foo\160bar"))
119+ ("Foo~~bar" =?> para "Foo\160bar")
120120
121121 , testGroup "Code markup"
122122 [ "Code" =: "=foo(bar)=" =?> para (code "foo(bar)")
@@ -457,15 +457,15 @@ tests =
457457 , testGroup "Directives"
458458 [ "Title" =:
459459 "#title Document title" =?>
460− let titleInline = toList $ "Document title"
461− meta = setMeta "title" (MetaInlines titleInline) $ nullMeta
460+ let titleInline = toList "Document title"
461+ meta = setMeta "title" (MetaInlines titleInline) nullMeta
462462 in Pandoc meta mempty
463463 -- Emacs Muse documentation says that "You can use any combination
464464 -- of uppercase and lowercase letters for directives",
465465 -- but also allows '-', which is not documented, but used for disable-tables.
466466 , test emacsMuse "Disable tables"
467467 ("#disable-tables t" =?>
468− Pandoc (setMeta "disable-tables" (MetaInlines $ toList "t") $ nullMeta) mempty)
468+ Pandoc (setMeta "disable-tables" (MetaInlines $ toList "t") nullMeta) mempty)
469469 ]
470470 , testGroup "Anchors"
471471 [ "Anchor" =: