summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/HTML.hs
diff options
context:
space:
mode:
authordr@jones.dk <dr@jones.dk>2010-03-29 21:36:23 +0200
committerdr@jones.dk <dr@jones.dk>2010-03-29 21:36:23 +0200
commitc5408a001e497aed5733e00346bcba7e06cb65ba (patch)
treeda10f02052410c5d7c5db1d8987fe88e4a5bb757 /src/Text/Pandoc/Readers/HTML.hs
parent96d4f941026a8eca3ba211facdc8ce66b2ab38bb (diff)
Imported Upstream version 1.5.1.1
Diffstat (limited to 'src/Text/Pandoc/Readers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 2e5473992..5c188e3d9 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -1,5 +1,5 @@
{-
-Copyright (C) 2006-8 John MacFarlane <jgm@berkeley.edu>
+Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- |
Module : Text.Pandoc.Readers.HTML
- Copyright : Copyright (C) 2006-8 John MacFarlane
+ Copyright : Copyright (C) 2006-2010 John MacFarlane
License : GNU GPL, version 2 or above
Maintainer : John MacFarlane <jgm@berkeley.edu>
@@ -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 (escapeURI u) of
Just p -> (map toLower $ uriScheme p) `notElem` safeURISchemes
Nothing -> True
@@ -746,7 +746,7 @@ link = try $ do
Nothing -> fail "no href"
let title = fromMaybe "" $ extractAttribute "title" attributes
lab <- inlinesTilEnd "a"
- return $ Link (normalizeSpaces lab) (url, title)
+ return $ Link (normalizeSpaces lab) (escapeURI url, title)
image :: GenParser Char ParserState Inline
image = try $ do
@@ -756,5 +756,5 @@ image = try $ do
Nothing -> fail "no src"
let title = fromMaybe "" $ extractAttribute "title" attributes
let alt = fromMaybe "" (extractAttribute "alt" attributes)
- return $ Image [Str alt] (url, title)
+ return $ Image [Str alt] (escapeURI url, title)