diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-12-06 19:38:25 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2017-12-06 19:38:25 +0300 |
commit | e536c4d9c9c4ff73213dc0273654ea3e1916f22e (patch) | |
tree | 944c84c1fd2440af27c42c0c8572bf90e3910295 | |
parent | 6fd3cdac46f916b74d88aab696dc81c93581c162 (diff) | |
download | pandoc-e536c4d9c9c4ff73213dc0273654ea3e1916f22e.tar.gz |
hlint Muse reader and tests
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 8 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 72344bfe0..04cec149b 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -148,7 +148,7 @@ atStart p = do -- -- While not documented, Emacs Muse allows "-" in directive name -parseDirectiveKey :: PandocMonad m => MuseParser m (String) +parseDirectiveKey :: PandocMonad m => MuseParser m String parseDirectiveKey = do char '#' many (letter <|> char '-') @@ -173,7 +173,7 @@ parseAmuseDirective = do value <- parseFromString (trimInlinesF . mconcat <$> many inline) $ unlines (first : rest) return (key, value) where - endOfDirective = lookAhead $ endOfInput <|> (try $ void blankline) <|> (try $ void parseDirectiveKey) + endOfDirective = lookAhead $ endOfInput <|> try (void blankline) <|> try (void parseDirectiveKey) endOfInput = try $ skipMany blankline >> skipSpaces >> eof directive :: PandocMonad m => MuseParser m () @@ -428,7 +428,7 @@ listStart marker = try $ do dropSpacePrefix :: [String] -> [String] dropSpacePrefix lns = map (drop maxIndent) lns - where flns = filter (\s -> not $ all (== ' ') s) lns + where flns = filter (not . all (== ' ')) lns maxIndent = if null flns then 0 else length $ takeWhile (== ' ') $ foldl1 commonPrefix flns listItemContents :: PandocMonad m => Int -> MuseParser m (F Blocks) @@ -620,7 +620,7 @@ inlineList = [ endline ] inline :: PandocMonad m => MuseParser m (F Inlines) -inline = (choice inlineList) <?> "inline" +inline = choice inlineList <?> "inline" endline :: PandocMonad m => MuseParser m (F Inlines) endline = try $ do diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index a25b41937..28db0191b 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -116,7 +116,7 @@ tests = , "Linebreak" =: "Line <br> break" =?> para ("Line" <> linebreak <> "break") , test emacsMuse "Non-breaking space" - ("Foo~~bar" =?> para ("Foo\160bar")) + ("Foo~~bar" =?> para "Foo\160bar") , testGroup "Code markup" [ "Code" =: "=foo(bar)=" =?> para (code "foo(bar)") @@ -457,15 +457,15 @@ tests = , testGroup "Directives" [ "Title" =: "#title Document title" =?> - let titleInline = toList $ "Document title" - meta = setMeta "title" (MetaInlines titleInline) $ nullMeta + let titleInline = toList "Document title" + meta = setMeta "title" (MetaInlines titleInline) nullMeta in Pandoc meta mempty -- Emacs Muse documentation says that "You can use any combination -- of uppercase and lowercase letters for directives", -- but also allows '-', which is not documented, but used for disable-tables. , test emacsMuse "Disable tables" ("#disable-tables t" =?> - Pandoc (setMeta "disable-tables" (MetaInlines $ toList "t") $ nullMeta) mempty) + Pandoc (setMeta "disable-tables" (MetaInlines $ toList "t") nullMeta) mempty) ] , testGroup "Anchors" [ "Anchor" =: |