aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-02-23 21:58:10 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-02-23 21:58:10 -0800
commitf2bd6fd37ce6b6dfc0c382fefd3cecde57951740 (patch)
tree928b5d951e3b2239e1ee812e7328dc9cc9316ae7
parent0180807a6cb9cefc507a0b4e50ec1753fd3eaf5d (diff)
downloadpandoc-f2bd6fd37ce6b6dfc0c382fefd3cecde57951740.tar.gz
Make protocol-relative URIs work again.
Closes #2737.
-rw-r--r--src/Text/Pandoc/Shared.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index b5efcf172..075d76847 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -892,8 +892,10 @@ readDataFileUTF8 userDir fname =
parseURIReference' :: String -> Maybe URI
parseURIReference' s =
case parseURIReference s of
- Just u | length (uriScheme u) > 2 -> Just u
- _ -> Nothing
+ Just u
+ | length (uriScheme u) > 2 -> Just u
+ | null (uriScheme u) -> Just u -- protocol-relative
+ _ -> Nothing
-- | Fetch an image or other item from the local filesystem or the net.
-- Returns raw content and maybe mime type.