git.iko.soy/typeable/pandoc
on master help sign in
Fixed svg handling in EPUB writer.

This is a crude workaroud for #2183. A correct fix would require having openURL and fetchItem return a content encoding as well as a content type.

commitadfb217622a482ad716d9e65e48caef38f7c3654 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 27 May 2015, 11:46 (11 years ago) parentc99e057
2 files changed+4−1
src/Text/Pandoc/MIME.hs+3−1 src/Text/Pandoc/Shared.hs+1
src/Text/Pandoc/MIME.hs+3−1
@@ -433,7 +433,9 @@ mimeTypesList = -- List borrowed from happstack-server.
433433 ,("sv4cpio","application/x-sv4cpio")
434434 ,("sv4crc","application/x-sv4crc")
435435 ,("svg","image/svg+xml")
436− ,("svgz","image/svg+xml")
436+ -- removed for now, since it causes problems with
437+ -- extensionFromMimeType: see #2183.
438+ -- ,("svgz","image/svg+xml")
437439 ,("sw","chemical/x-swissprot")
438440 ,("swf","application/x-shockwave-flash")
439441 ,("swfl","application/x-shockwave-flash")
src/Text/Pandoc/Shared.hs+1
@@ -796,6 +796,7 @@ fetchItem sourceURL s =
796796 fp = unEscapeString $ dropFragmentAndQuery s
797797 mime = case takeExtension fp of
798798 ".gz" -> getMimeType $ dropExtension fp
799+ ".svgz" -> getMimeType $ dropExtension fp ++ ".svg"
799800 x -> getMimeType x
800801 ensureEscaped x@(_:':':'\\':_) = x -- likely windows path
801802 ensureEscaped x = escapeURIString isAllowedInURI x