summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/SelfContained.hs
diff options
context:
space:
mode:
authorArtyom Kazak <yom@artyom.me>2014-08-17 20:42:30 +0400
committerArtyom Kazak <yom@artyom.me>2014-08-17 21:00:50 +0400
commitcca9e8feb4b8c0638147e330cd7151bddb150c70 (patch)
treee7a53427c485941d5a82da79617b00bd630463f1 /src/Text/Pandoc/SelfContained.hs
parent9d52ecdd422a6821c9f37f53e3d30d4be4e41e8f (diff)
MIME cleanup.
* Create a type synonym for MIME type (instead of `String`). * Add `getMimeTypeDef` function. * Avoid recreating MIME type `Map`s every time. * Move “Formula-...” case handling into `getMimeType`.
Diffstat (limited to 'src/Text/Pandoc/SelfContained.hs')
-rw-r--r--src/Text/Pandoc/SelfContained.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs
index 1a4e037cf..36839ddd0 100644
--- a/src/Text/Pandoc/SelfContained.hs
+++ b/src/Text/Pandoc/SelfContained.hs
@@ -42,6 +42,7 @@ import Codec.Compression.GZip as Gzip
import qualified Data.ByteString.Lazy as L
import Text.Pandoc.Shared (renderTags', err, fetchItem')
import Text.Pandoc.MediaBag (MediaBag)
+import Text.Pandoc.MIME (MimeType)
import Text.Pandoc.UTF8 (toString, fromString)
import Text.Pandoc.Options (WriterOptions(..))
@@ -98,8 +99,8 @@ cssURLs media sourceURL d orig =
";base64," `B.append` (encode raw)
return $ x `B.append` "url(" `B.append` enc `B.append` rest
-getRaw :: MediaBag -> Maybe String -> String -> String
- -> IO (ByteString, String)
+getRaw :: MediaBag -> Maybe String -> MimeType -> String
+ -> IO (ByteString, MimeType)
getRaw media sourceURL mimetype src = do
let ext = map toLower $ takeExtension src
fetchResult <- fetchItem' media sourceURL src