aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-03-22 19:29:37 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-03-23 00:33:50 -0700
commit71eac37ac555b41325c334f662facc5308f43b64 (patch)
treeb560d3d95d78cea5c6606639c1915de9dbe88f80 /src/Text/Pandoc/Readers
parent7689cacb5d0147e79b9080607bb35a0dd262b96a (diff)
downloadpandoc-71eac37ac555b41325c334f662facc5308f43b64.tar.gz
Fixed treatment of unicode characters in URIs.
* Added stringToURI to Shared. This is used in the HTML writer for all URIs. It properly URI-encodes high characters (> 127), leaving everything else (including symbols and spaces) the same. * Modified unsanitaryURI to allow UTF8 characters in a URI. (First, we convert the URI to URI-encoded octets, then we pass through parseURIReference.) This resolves gitit Issue #99. Previously '[abc](http://gitit.net/测试)' would not be rendered as a link when --sanitize was selected.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 2e5473992..317c002e9 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -182,7 +182,7 @@ unsanitaryURI u =
"ldaps:", "magnet:", "mms:", "msnim:", "notes:", "rsync:",
"secondlife:", "skype:", "ssh:", "sftp:", "smb:", "sms:",
"snews:", "webcal:", "ymsgr:"]
- in case parseURIReference u of
+ in case parseURIReference (stringToURI u) of
Just p -> (map toLower $ uriScheme p) `notElem` safeURISchemes
Nothing -> True