Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0721358

Browse files
committed
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: ( < > .
1 parent bef74b5 commit 0721358

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Tools/faqwiz/faqwiz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def translate(text, pre=0):
8787
list.append(escape(text[i:j]))
8888
i = j
8989
url = prog.group(0)
90-
while url[-1] in ');:,.?\'"':
90+
while url[-1] in '();:,.?\'"<>':
9191
url = url[:-1]
92+
i = i + len(url)
9293
url = escape(url)
9394
if not pre or (pre and PROCESS_PREFORMAT):
9495
if ':' in url:
@@ -98,7 +99,6 @@ def translate(text, pre=0):
9899
else:
99100
repl = url
100101
list.append(repl)
101-
i = i + len(url)
102102
j = len(text)
103103
list.append(escape(text[i:j]))
104104
return string.join(list, '')

0 commit comments

Comments
 (0)