|
From: Jeff B. <its...@gm...> - 2008-05-30 21:25:23
|
In 2.5 the result is wrapped in a ParseResult class so that fields can be
accessed by name, but a plain tuple is returned in 2.4.
---
I don't think I've seen any patches on the list yet, but you can apply it with
git-am.
markdown.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/markdown.py b/markdown.py
index 3348acc..422cde4 100644
--- a/markdown.py
+++ b/markdown.py
@@ -34,7 +34,7 @@ __revision__ = "$Rev$"
import re, sys, codecs
-from urlparse import urlparse
+from urlparse import urlparse, urlunparse
from logging import getLogger, StreamHandler, Formatter, \
DEBUG, INFO, WARN, ERROR, CRITICAL
@@ -930,9 +930,9 @@ class LinkPattern (Pattern):
"""
locless_schemes = ['', 'mailto', 'news']
- url = urlparse(url)
+ scheme, netloc, path, params, query, fragment = url = urlparse(url)
safe_url = False
- if url.netloc != '' or url.scheme in locless_schemes:
+ if netloc != '' or scheme in locless_schemes:
safe_url = True
for part in url[2:]:
@@ -942,7 +942,7 @@ class LinkPattern (Pattern):
if self.safe_mode and not safe_url:
return ''
else:
- return url.geturl()
+ return urlunparse(url)
class ImagePattern(LinkPattern):
""" Return a NanoDom img Element from the given match. """
--
1.5.5.1
|