Commits

Anonymous committed e9c73ef

Tweak URI detection RE to capture non-ascii symbols. Fixes #5675

  • Participants
  • Parent commits 5f046ba

Comments (0)

Files changed (1)

src/gui_interface.py

         # FIXME: recognize xmpp: and treat it specially
         links = r"((?<=\()[A-Za-z][A-Za-z0-9\+\.\-]*:"\
             r"([\w\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+"\
-            r"(?=\)))|([A-Za-z][A-Za-z0-9\+\.\-]*:([\w\.\-_~:/\?#\[\]@!\$"\
-            r"&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+)"
+            r"(?=\)))|(\w[\w\+\.\-]*:(\S|%[A-Fa-f0-9]{2})+)"
 
         # 2nd one: at_least_one_char@at_least_one_char.at_least_one_char
         mail = r'\bmailto:\S*[^\s\W]|' r'\b\S+@\S+\.\S*[^\s\W]'
         basic_pattern = links + '|' + mail + '|' + legacy_prefixes
 
         link_pattern = basic_pattern
-        self.link_pattern_re = re.compile(link_pattern, re.IGNORECASE)
+        self.link_pattern_re = re.compile(link_pattern, re.IGNORECASE |
+                re.UNICODE)
 
         if gajim.config.get('use_latex'):
             basic_pattern += latex