From d0e088d535a478b9435ff49fd27583f5cb9c2641 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 9 Jan 2014 23:43:52 -0500 Subject: No longer percent encode spaces in urls. The current implementation was wrong as it also percent encoded query strings (which should be plus encoded) and calling urllib.quote on the path (and urllib.quote_plus on the query string) assumes the url is not already encoded. What if the document author pasted a url that was already encoded? She probably did not intend for `%20` to become `%2520`. Or did she? It is now clear to me why many implementation do nothing to urls. Just pass them though as-is. To bad if they are not valid HTML. HTML authors have to encodee their own urls, so I guess markdown authors have to as well. --- markdown/inlinepatterns.py | 1 - 1 file changed, 1 deletion(-) (limited to 'markdown/inlinepatterns.py') diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py index c0bd3d1..9335748 100644 --- a/markdown/inlinepatterns.py +++ b/markdown/inlinepatterns.py @@ -344,7 +344,6 @@ class LinkPattern(Pattern): `username:password@host:port`. """ - url = url.replace(' ', '%20') if not self.markdown.safeMode: # Return immediately bipassing parsing. return url -- cgit v1.2.3