diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-03-22 19:29:37 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-03-23 00:33:50 -0700 |
commit | 71eac37ac555b41325c334f662facc5308f43b64 (patch) | |
tree | b560d3d95d78cea5c6606639c1915de9dbe88f80 /src/Text/Pandoc/Readers | |
parent | 7689cacb5d0147e79b9080607bb35a0dd262b96a (diff) | |
download | pandoc-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.hs | 2 |
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 |