summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/SelfContained.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-27 23:13:55 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-27 23:13:55 -0700
commitcbcb9b36c088b3dd1e07f9d0318594b78e5d38f2 (patch)
tree4073e58a0c4ce88f5fb7c48d63b213129ced80fe /src/Text/Pandoc/SelfContained.hs
parent84812983573232a1dc25f68268acfa9b28ac5a22 (diff)
hlint suggestions.
Diffstat (limited to 'src/Text/Pandoc/SelfContained.hs')
-rw-r--r--src/Text/Pandoc/SelfContained.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs
index b599eb62b..d3b768109 100644
--- a/src/Text/Pandoc/SelfContained.hs
+++ b/src/Text/Pandoc/SelfContained.hs
@@ -178,10 +178,10 @@ pCSSComment = P.try $ do
return B.empty
pCSSOther :: PandocMonad m => ParsecT ByteString () m ByteString
-pCSSOther = do
+pCSSOther =
(B.pack <$> P.many1 (P.noneOf "u/ \n\r\t")) <|>
- (B.singleton <$> P.char 'u') <|>
- (B.singleton <$> P.char '/')
+ (B.singleton <$> P.char 'u') <|>
+ (B.singleton <$> P.char '/')
pCSSUrl :: PandocMonad m
=> FilePath -> ParsecT ByteString () m ByteString
@@ -218,9 +218,7 @@ handleCSSUrl :: PandocMonad m
=> FilePath -> (String, ByteString)
-> ParsecT ByteString () m
(Either ByteString (MimeType, ByteString))
-handleCSSUrl d (url, fallback) = do
- -- pipes are used in URLs provided by Google Code fonts
- -- but parseURI doesn't like them, so we escape them:
+handleCSSUrl d (url, fallback) =
case escapeURIString (/='|') (trim url) of
'#':_ -> return $ Left fallback
'd':'a':'t':'a':':':_ -> return $ Left fallback
@@ -251,8 +249,7 @@ getData mimetype src = do
let ext = map toLower $ takeExtension src
(raw, respMime) <- fetchItem src
let raw' = if ext == ".gz"
- then B.concat $ L.toChunks $ Gzip.decompress $ L.fromChunks
- $ [raw]
+ then B.concat $ L.toChunks $ Gzip.decompress $ L.fromChunks [raw]
else raw
mime <- case (mimetype, respMime) of
("",Nothing) -> throwError $ PandocSomeError