fix typos
This commit is contained in:
parent
6812e423d7
commit
aba99dc208
1 changed files with 3 additions and 2 deletions
|
@ -1060,13 +1060,14 @@ class Interface:
|
||||||
# \S*[^\s\W] --> in the matching string don't match ? or ) etc.. if at the end
|
# \S*[^\s\W] --> in the matching string don't match ? or ) etc.. if at the end
|
||||||
# so http://be) will match http://be and http://be)be) will match http://be)be
|
# so http://be) will match http://be and http://be)be) will match http://be)be
|
||||||
|
|
||||||
prefixes = ('http://', 'https://', 'news://', 'ftp://', 'ed2k://', 'www\.', 'ftp\.')
|
prefixes = (r'http://', r'https://', r'news://', r'ftp://', r'ed2k://', r'www\.', r'ftp\.')
|
||||||
# NOTE: it's ok to catch www.gr such stuff exist!
|
# NOTE: it's ok to catch www.gr such stuff exist!
|
||||||
|
|
||||||
prefix_pattern = ''
|
prefix_pattern = ''
|
||||||
for prefix in prefixes:
|
for prefix in prefixes:
|
||||||
prefix_pattern += prefix + '|'
|
prefix_pattern += prefix + '|'
|
||||||
|
|
||||||
|
prefix_pattern = prefix_pattern[:-1] # remove last |
|
||||||
prefix_pattern = '(' + prefix_pattern + ')'
|
prefix_pattern = '(' + prefix_pattern + ')'
|
||||||
|
|
||||||
links = r'\b' + prefix_pattern + r'\S*[^\s\W]|'
|
links = r'\b' + prefix_pattern + r'\S*[^\s\W]|'
|
||||||
|
|
Loading…
Add table
Reference in a new issue