From: Michael Orlitzky Date: Fri, 28 Sep 2012 04:55:10 +0000 (-0400) Subject: "Fix" the unicode URL bug. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=commitdiff_plain;h=c07b67fc6fafd67364686ee51f844e0ac5b790d6 "Fix" the unicode URL bug. --- diff --git a/src/LWN/Page.hs b/src/LWN/Page.hs index 3d53284..c39a2f5 100644 --- a/src/LWN/Page.hs +++ b/src/LWN/Page.hs @@ -163,8 +163,9 @@ replace_remote_img_srcs image_map = change_src_func :: String -> String change_src_func old_src = case Map.lookup old_src image_map of - -- Leave it alone if we don't have the file locally - Nothing -> old_src + -- If we don't have the file, empty the src. Pandoc will crash + -- otherwise. + Nothing -> "" Just v -> v change_src :: (ArrowXml a) => a XmlTree XmlTree diff --git a/src/LWN/URI.hs b/src/LWN/URI.hs index 1601c37..f20c294 100644 --- a/src/LWN/URI.hs +++ b/src/LWN/URI.hs @@ -131,6 +131,7 @@ is_lwn_url s = +-- Bug here, doesn't work on unicode paths! filename :: URL -> Maybe String filename url = case parse_result of