From c07b67fc6fafd67364686ee51f844e0ac5b790d6 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 28 Sep 2012 00:55:10 -0400 Subject: [PATCH] "Fix" the unicode URL bug. --- src/LWN/Page.hs | 5 +++-- src/LWN/URI.hs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) 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 -- 2.44.2