From: Yuri T. <qar...@gm...> - 2008-05-30 22:18:45
|
Thanks. I pushed this commit. Sorry about this, not sure when this has slipped in. My goal has been to keep compatibility not only with 2.4 but also with 2.3. I also noticed that while markdown.py works with 2.3 (well used to, and now again with your patch), the test-markdown.py script did not. So, I changed test-markdown.py to work with 2.3. So, let's all agree that test-markdown.py should be ran with python2.3, python2.4 and python2.5 after each change. If you cannot check it with all three, then make a commit in a branch and email it to me so that I could test before merging. Also, Waylan and David, can you check in test cases for the fixes you made in the recent months? BTW, I also noticed that we have a regression on one of the tests. I suspect this might be the price we are paying for some of the other issues that Waylan fixed. Hopefully we'll resolve this with Artem's help over the next few months. - yuri On Fri, May 30, 2008 at 2:22 PM, Jeff Balogh <its...@gm...> wrote: > 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 > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss > -- http://sputnik.freewisdom.org/ |