GNOME Bugzilla – Bug 640752
Improper handling of links to notes whose titles begin with '[', '{', '(', or ':'
Last modified: 2017-07-31 12:41:07 UTC
Created attachment 179464 [details] Test cases. Please describe the problem: When I create a note with a name beginning with '[', '{', '(', or ':', and then write that name inside other note, a link is created. But, if I write the word "what.,? " before the name, the link is NOT created. This bug is similar to Bug #584362 (https://bugzilla.gnome.org/show_bug.cgi?id=584362) except the title of note being linked should begin with '[', '{', '(', or ':'. Therefore, most of content here are copied from Bug #584362. In addition, this bug was originally reported at Debian Bug #610999 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610999). Steps to reproduce: 1. I had a note called "[Hello] world". 2. Typing "[Hello] world" in another note creates a link. 3. But if I write "what,.? [Hello] world", the link disappears. 4. It seems that writing "what,.? " (with spaces) before the name of the note makes the link disappear. 5. This doesn't happen if you put tabs between "what,.?" and "[Hello] world". 6. Changing the note title in 1. to "{Hello} world", "(Hello) world", and ":Hello: world" causes the same result. Please see attached figure for detailed test cases. Actual results: There is no link. Expected results: There should be a link. Does this happen every time? Yes.
Created attachment 179465 [details] Another part of test cases.
Created attachment 229764 [details] [review] proposed patch for bug 640752
Review of attachment 229764 [details] [review]: I would say this logic highlights more cases than the current one, but also has side effects. It, for example, will highlight the note name in "test.[Hello] world" or in "[Hello] world.test" which, I think, can lead to undesired results for users. Generally, the current logic you're replacing with the patch is correct, the problem stems from the fact that (as far as I've investigated, pls feel free to correct me if I'm wrong) underlying Pango library doesn't count "[" or "{" or similar at the beginning or the word "the beginning of teh word" and StartsWord method returns False. Same for the end of the word and EndsWord (which is what bug 687181 is about, so I'd echo Alemann and propose to merge the two). That leads to the names of the notes not being highlighted inside of the sentences, while they should be per the spirit of the current logic. I would say we'd need either to apply this patch as an interim fix (with known side effects) - if the problem is hot - or just think a little more on how can we work this Pango behavior around.
*** Bug 687181 has been marked as a duplicate of this bug. ***
Hm, I had actually thought that the 'side effects' you gave were the desired behavior! I'll try to come up with some new logic, Now that I know what should actually happen.
The Tomboy team has moved from GNOME Bugzilla to GitHub for bug reports and feature requests: https://github.com/tomboy-notes/tomboy/issues/ Closing this report as NOTGNOME as part of Bugzilla Housekeeping (bug 781054) to keep tasks in one place. Please feel free to transfer this task to GitHub if this task is still valid in a recent Tomboy version. We are sorry for the inconvenience.