diff options
author | Guido van Rossum <guido@python.org> | 1997-12-16 21:12:47 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-12-16 21:12:47 (GMT) |
commit | 0721358969aa14f5f38601f0d921a6ec5432e5d6 (patch) | |
tree | a318be85a308d685ae759aa45a27123f2c526556 | |
parent | bef74b5605f180532f8dda581e143b16001782ab (diff) | |
download | cpython-0721358969aa14f5f38601f0d921a6ec5432e5d6.zip cpython-0721358969aa14f5f38601f0d921a6ec5432e5d6.tar.gz cpython-0721358969aa14f5f38601f0d921a6ec5432e5d6.tar.bz2 |
Fix a bug in translate(): the pointer was incremented by the length of
the *escaped* url. Also added new special characters that are not
part of the url when found at the end: ( < > .
-rw-r--r-- | Tools/faqwiz/faqwiz.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py index 9282b36..14c4b30 100644 --- a/Tools/faqwiz/faqwiz.py +++ b/Tools/faqwiz/faqwiz.py @@ -87,8 +87,9 @@ def translate(text, pre=0): list.append(escape(text[i:j])) i = j url = prog.group(0) - while url[-1] in ');:,.?\'"': + while url[-1] in '();:,.?\'"<>': url = url[:-1] + i = i + len(url) url = escape(url) if not pre or (pre and PROCESS_PREFORMAT): if ':' in url: @@ -98,7 +99,6 @@ def translate(text, pre=0): else: repl = url list.append(repl) - i = i + len(url) j = len(text) list.append(escape(text[i:j])) return string.join(list, '') |