After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 531085 - Improper handling of links (note and URL) terminating with '[', '}', or ')'
Improper handling of links (note and URL) terminating with '[', '}', or ')'
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
0.10.x
Other All
: High minor
: 1.8.0
Assigned To: Tomboy Maintainers
Tomboy Maintainers
: 484264 567914 584999 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-02 15:49 UTC by dalloliogm
Modified: 2011-06-26 05:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
modify regexp rule to match url ending with anything but spaces (537 bytes, patch)
2009-03-03 21:50 UTC, Florian Pinault
none Details | Review
identical rewrite regexpr for urlwatcher (1.73 KB, patch)
2009-03-04 11:33 UTC, Florian Pinault
none Details | Review
modify regexp rule to match some url with parenthesis (2.30 KB, patch)
2009-03-04 17:41 UTC, Florian Pinault
none Details | Review
screen shot for attachment id=130041 (382.34 KB, image/png)
2009-03-04 17:42 UTC, Florian Pinault
  Details
modify regexp rule to match some url with matching parenthesis (2.58 KB, patch)
2009-03-05 11:07 UTC, Florian Pinault
none Details | Review
screen shot for patch 130109 (9.67 KB, image/png)
2009-03-05 11:09 UTC, Florian Pinault
  Details
https url (4.27 KB, image/png)
2009-03-26 14:27 UTC, Michael Monreal
  Details
rewrite of previous patch (3.97 KB, patch)
2009-03-26 16:18 UTC, Florian Pinault
needs-work Details | Review
possibly better patch (2.06 KB, patch)
2009-06-06 23:19 UTC, Sandy Armstrong
accepted-commit_after_freeze Details | Review
Fixes the regression with regular text starting with [ ( { (2.01 KB, patch)
2011-06-13 06:46 UTC, Aaron D Borden
committed Details | Review

Description dalloliogm 2008-05-02 15:49:22 UTC
Tomboy doesn't handle urls terminating with a '[' properly.

For example, try to paste a url like this: http://www.ncbi.nlm.nih.gov/sites/entrez?Db=gene&Cmd=DetailsSearch&Term=SLC40A1[Gene%2FProtein+Name] on a tomboy note.

The last bracket will be not highlighted as a part of the link.
I can paste a screenshot if you think it is necessary.

Other information:
Comment 1 Sandy Armstrong 2008-05-17 13:35:44 UTC
Confirmed in 0.11.0.
Comment 2 Sandy Armstrong 2009-01-15 22:19:57 UTC
Also a problem with '}'.
Comment 3 Sandy Armstrong 2009-01-15 22:20:42 UTC
*** Bug 567914 has been marked as a duplicate of this bug. ***
Comment 4 Sandy Armstrong 2009-01-15 22:26:00 UTC
Also a problem with ')'.

Also, note names with any of these characters at the end have linking problems.  If I have a note called "testing (parens)", and add that text in another note, the link appears.  However, if I add a space to that text, the link disappears.
Comment 5 Sandy Armstrong 2009-01-15 22:27:08 UTC
*** Bug 484264 has been marked as a duplicate of this bug. ***
Comment 6 Sandy Armstrong 2009-02-16 22:08:34 UTC
This was fixed for note links in bug #323845.

I am hoping that a fix for bug #436994 might fix the rest of this...
Comment 7 Sandy Armstrong 2009-03-02 22:21:36 UTC
So this is not fixed, though there is an unreviewed patch by Florian attached to bug #436994.

My feeling is that it's a pretty common use-case to put URLs in square brackets and parentheses.  Maybe more common than URLs including those characters (although Wikipedia may tilt the odds back again).  Anyway, maybe we shouldn't link too aggressively.

What do people think about accepting ], }, and ), but only if the first character of the text being evaluated isn't the corresponding opening character?  Would like to see such a patch.
Comment 8 Florian Pinault 2009-03-03 21:50:00 UTC
Created attachment 129969 [details] [review]
modify regexp rule to match url ending with anything but spaces

This is the patch added to bug #436994.
Comment 9 Sandy Armstrong 2009-03-04 07:00:13 UTC
Thanks for the patch, Florian.  Any thoughts on comment #7?
Comment 10 Florian Pinault 2009-03-04 11:33:22 UTC
Created attachment 130006 [details] [review]
identical rewrite regexpr for urlwatcher 

I just rewrote the regexpr to make it easier to read.
There is a "regression test" writing different version of the regexpr to log.

I agree with comment #7. Interesting regexp exercice...
Comment 11 Michael Monreal 2009-03-04 17:40:18 UTC
Here's probably another link bug: Just type the following in a note

/bin/bash AAA		/bin/bash

(That's two tabs behind AAA.)

The underline starts under the whitespace of the second tab.
Comment 12 Florian Pinault 2009-03-04 17:41:41 UTC
Created attachment 130041 [details] [review]
modify regexp rule to match some url with parenthesis

Well, that's all what I could come to.

This patch changes the way url are detected. 

If a ( or [ or { is found at the beginning of the string, then ) and ] and } are forbidden in the address.
Else any non space is allowed.

(see screenshot)
Comment 13 Florian Pinault 2009-03-04 17:42:51 UTC
Created attachment 130042 [details]
screen shot for  attachment id=130041
Comment 14 Sandy Armstrong 2009-03-04 17:49:52 UTC
(In reply to comment #11)
> Here's probably another link bug: Just type the following in a note
> 
> /bin/bash AAA           /bin/bash
> 
> (That's two tabs behind AAA.)
> 
> The underline starts under the whitespace of the second tab.
> 

I think you're in the wrong bug.  You want bug #436994, which was fixed for the 0.13.6 release (for which I have yet to send a release email because I haven't made the Windows installer yet).
Comment 15 Michael Monreal 2009-03-04 18:15:00 UTC
(In reply to comment #14)
> I think you're in the wrong bug.  You want bug #436994, which was fixed for the
> 0.13.6 release 

Right, and fixed with trunk, thanks :)
Comment 16 Stefan Schweizer 2009-03-04 18:18:21 UTC
(In reply to comment #13)
> Created an attachment (id=130042) [edit]
> screen shot for  attachment id=130041
>

I cannot open the screenshot. Bugzilla says the image contains errors?
Comment 17 Sandy Armstrong 2009-03-04 18:29:31 UTC
(In reply to comment #16)
> (In reply to comment #13)
> > Created an attachment (id=130042) [edit]
> > screen shot for  attachment id=130041
> >
> 
> I cannot open the screenshot. Bugzilla says the image contains errors?
> 

Worked for me when I downloaded and opened with eog.
Comment 18 Benjamin Podszun 2009-03-04 18:36:56 UTC
That file is no PNG..
file says: PostScript document text conforming at level 3.0
Comment 19 Florian Pinault 2009-03-05 09:30:10 UTC
sorry, that the first screenshot I take.
I used "import filename"
it works well with evince.
Comment 20 Florian Pinault 2009-03-05 11:07:37 UTC
Created attachment 130109 [details] [review]
modify regexp rule to match some url with matching parenthesis 

All right, this should work fine. I think this implement comment #7.
> accepting ], }, and ), but only if the first character of the text being 
> evaluated isn't the corresponding opening character?  Would like to see such a 
> patch.

note : accepts also any other non-space character. like http://kj;,;:

test cases are :

(http://toto.com}])etc
{http://toto.com)]}etc
[http://toto.com)}]etc

( http://toto.com}])etc
{ http://toto.com)]}etc
[ http://toto.com)}]etc

http://toto.com}])etc
http://toto.com)]}etc
http://toto.com)}]etc

screenshot follows (hopefully true png ;-) )
Comment 21 Florian Pinault 2009-03-05 11:09:01 UTC
Created attachment 130110 [details]
screen shot for patch 130109
Comment 22 Michael Monreal 2009-03-26 14:27:08 UTC
Created attachment 131432 [details]
https url

URLs beginning with "https" are no longer correctly handled (I *think* they used to be). Just "http" works fine...
Comment 23 Florian Pinault 2009-03-26 16:18:51 UTC
Created attachment 131443 [details] [review]
rewrite of previous patch

Sorry, I can't reproduce your screenshot, https works for me like http.
this may be due to incorrect handling of '+' starting the new code in the patch.

I moved the '+' signs to make it clearer.
Comment 24 Sandy Armstrong 2009-06-06 15:23:09 UTC
*** Bug 584999 has been marked as a duplicate of this bug. ***
Comment 25 Sandy Armstrong 2009-06-06 15:42:02 UTC
Trying this patch out and it's working really well, with one big exception:

/path/to/somewhere
~/path/in/homedir

Those no longer work, sadly.  I'm playing with it now, though.  These, at least seem to work:

[/path/to/somewhere]
[~/path/in/homedir]

Also, I need to reintegrate my fix from this commit:
http://git.gnome.org/cgit/tomboy/commit/?id=ca90435a4112c0870f5bf389bee971b7540b53c7

By the way, Florian, there are some extra changes not related to this bug in your latest patch.
Comment 26 Sandy Armstrong 2009-06-06 23:19:31 UTC
Created attachment 136072 [details] [review]
possibly better patch

It's kind of messily-formatted right now, but I think this may be better.  Wanted to attach before I forgot/lost it (heading out for a bit).  Will follow up later! :-)
Comment 27 Aaron D Borden 2011-06-10 23:55:19 UTC
Comment on attachment 136072 [details] [review]
possibly better patch

committed bde1d9a547936b40d40fa627acf36f5b3b3dbd01

Sandy's patch handles all the cases above.
Comment 28 Aaron D Borden 2011-06-12 23:50:46 UTC
Actually, we're matching all strings that are preceded with ( [ {
Again, underscore indicates start and end of a link

(_thisisnotanotebuthasalink_
[_thisisnotanotebuthasalink_
{_thisisnotanotebuthasalink_
Comment 29 Aaron D Borden 2011-06-13 06:46:59 UTC
Created attachment 189803 [details] [review]
Fixes the regression with regular text starting with [ ( {
Comment 30 Aaron D Borden 2011-06-13 18:37:32 UTC
Comment on attachment 136072 [details] [review]
possibly better patch

Revert "Fix handling of ] } ) in links"
This reverts commit bde1d9a547936b40d40fa627acf36f5b3b3dbd01. Patch introduces
a regression. Since it is related to linking, we'll consider it severe enough
that we should revert. There is a fix in bugzilla, once reviewed we can reapply
the patches.
Comment 31 Jared Jennings 2011-06-26 05:25:41 UTC
Review of attachment 189803 [details] [review]:

commit 32bc77abf14c4163f89a00174adcc560f123eec3
Comment 32 Jared Jennings 2011-06-26 05:26:30 UTC
committed to master 32bc77abf14c4163f89a00174adcc560f123eec3