Changeset 9898
- Timestamp:
- 07/08/08 20:49:51 (2 months ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
-
common/config.py (modified) (1 diff)
-
conversation_textview.py (modified) (3 diffs)
-
gajim.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/config.py
r9886 r9898 252 252 'check_idle_every_foo_seconds': [opt_int, 2, _('Choose interval between 2 checks of idleness.')], 253 253 'latex_png_dpi': [opt_str, '108',_('Change the value to change the size of latex formulas displayed. The higher is larger.') ], 254 'uri_schemes': [opt_str, 'http https ftp ftps gopher news ed2k irc magnet sip', _('Valid uri schemes. Only schemes in this list will be made accepted as "real" uri.')], 254 255 } 255 256 -
trunk/src/conversation_textview.py
r9827 r9898 908 908 # add with possible animation 909 909 self.tv.add_child_at_anchor(img, anchor) 910 #FIXME: one day, somehow sync with regexp in gajim.py 911 elif special_text.startswith('http://') or \ 912 special_text.startswith('www.') or \ 913 special_text.startswith('ftp://') or \ 914 special_text.startswith('ftp.') or \ 915 special_text.startswith('https://') or \ 916 special_text.startswith('gopher://') or \ 917 special_text.startswith('news://') or \ 918 special_text.startswith('ed2k://') or \ 919 special_text.startswith('irc://') or \ 920 special_text.startswith('sip:') or \ 921 special_text.startswith('magnet:'): 922 # it's a url 910 elif special_text.startswith('www.') or \ 911 special_text.startswith('ftp.'): 923 912 tags.append('url') 924 913 use_other_tags = False … … 992 981 use_other_tags = False 993 982 else: 994 #it's a url 995 tags.append('url') 996 use_other_tags = False 983 # Check if we accept this as an uri 984 schemes = gajim.config.get('uri_schemes').split() 985 for scheme in schemes: 986 if special_text.startswith(scheme + ':'): 987 tags.append('url') 988 use_other_tags = False 989 # It's not a accepted uri 990 if use_other_tags: 991 end_iter = buffer.get_end_iter() 992 buffer.insert_with_tags_by_name(end_iter, special_text, *other_tags) 997 993 998 994 if len(tags) > 0: … … 1172 1168 if name and (text.startswith('/me ') or text.startswith('/me\n')): 1173 1169 text = '* ' + name + text[3:] 1170 text_tags.append('italic') 1174 1171 # detect urls formatting and if the user has it on emoticons 1175 1172 index = self.detect_and_print_special_text(text, text_tags) -
trunk/src/gajim.py
r9894 r9898 2275 2275 # so http://be) will match http://be and http://be)be) will match http://be)be 2276 2276 2277 prefixes = '|'.join((r'http://', r'https://', r'gopher://', r'news://',2278 r'ftp://', r'ed2k://', r'irc://', r'magnet:', r'sip:', r'www\.',2279 r'ftp\.'))2277 legacy_prefixes = r"((?<=\()(www|ftp)\.([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+(?=\)))"\ 2278 r"|((www|ftp)\.([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+"\ 2279 r"\.([A-Za-z0-9\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+)" 2280 2280 # NOTE: it's ok to catch www.gr such stuff exist! 2281 2281 … … 2296 2296 latex = r'|\$\$[^$\\]*?([\]\[0-9A-Za-z()|+*/-]|[\\][\]\[0-9A-Za-z()|{}$])(.*?[^\\])?\$\$' 2297 2297 2298 basic_pattern = links + '|' + mail 2298 basic_pattern = links + '|' + mail + '|' + legacy_prefixes 2299 2299 2300 2300 if gajim.config.get('use_latex'):
