GNOME Bugzilla – Bug 602875
Wrong parsing of closing bracket in URL
Last modified: 2018-05-22 13:51:46 UTC
Created attachment 148415 [details] Screenshot of this issue (in Italian) If you type an URL with a closing bracket - instance http://it.wikipedia.org/wiki/Luca_(nome) - in empathy chat window the actual link target is the same URL without the closing bracket - i.e. http://it.wikipedia.org/wiki/Luca_(nome - Steps to reproduce: 1) start chatting 2) type a link with a closing bracket Results see attached screenshot More info Unchecked for adium themes.
Created attachment 148416 [details] Great!!! Firefox does the same. See previous comment or newly attached screenshot
This is a known issue. Our parser is not very smart, it should count opening and closing brackets. Otherwise we can't decide between: (http://foo.com) and http://foo.com/test(me) I don't think there is already a program doing both cases correctly. This bug could be a dup, I remember it was already reported. At least my "escape" branch[1] provides a good refactor and unit tests for those cases. It's a good base to fix this issue. [1] http://git.collabora.co.uk/?p=user/xclaesse/empathy.git;a=shortlog;h=refs/heads/escape
*** Bug 564735 has been marked as a duplicate of this bug. ***
http://daringfireball.net/2009/11/liberal_regex_for_matching_urls provides this regex for URI-matching: \b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))) "This pattern attempts to be practical. It makes no attempt to parse URLs according to any official specification. It isn’t limited to predefined URL protocols. It should be clever about things like parentheses and trailing punctuation...."
*** Bug 620820 has been marked as a duplicate of this bug. ***
*** Bug 646973 has been marked as a duplicate of this bug. ***
Jonny noticed that Gnome Shell uses a different algorithm which does the right thing with Wikipedia links. Maybe they should be in sync, one way or another?
Every project has their own way of doing this, and they are all broken in some way. But I did not check what gnome-shell does...
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/empathy/issues/145.