aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-06-28 18:35:21 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-06-28 18:35:21 -0700
commit6cdfde58076187daf4909ccd128067da5a1fe7f1 (patch)
treea4f1eec573a226f4e392e98389c508546b8eb76b /src/Text/Pandoc
parentd812036182ec69f2a1c48175e89393a289228c96 (diff)
downloadpandoc-6cdfde58076187daf4909ccd128067da5a1fe7f1.tar.gz
SelfContained: Fix handling of absolute URLs in css imports.
Also allow single-quoted values. Closes #535.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/SelfContained.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs
index 9332a3fa0..a80ab0c63 100644
--- a/src/Text/Pandoc/SelfContained.hs
+++ b/src/Text/Pandoc/SelfContained.hs
@@ -121,8 +121,12 @@ cssURLs userdata d orig =
let url = toString
$ case B.take 1 u of
"\"" -> B.takeWhile (/='"') $ B.drop 1 u
+ "'" -> B.takeWhile (/='\'') $ B.drop 1 u
_ -> u
- (raw, mime) <- getRaw userdata "" (d </> url)
+ let url' = if isAbsoluteURI url
+ then url
+ else d </> url
+ (raw, mime) <- getRaw userdata "" url'
rest <- cssURLs userdata d v
let enc = "data:" `B.append` fromString mime `B.append`
";base64," `B.append` (encode raw)