SelfContained: Fix handling of absolute URLs in css imports.

Also allow single-quoted values.

Closes #535.
This commit is contained in:
John MacFarlane 2012-06-28 18:35:21 -07:00
parent d812036182
commit 6cdfde5807

View file

@ -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)