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 303902 - Links with spaces in them are broken
Links with spaces in them are broken
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
unspecified
Other All
: Normal minor
: ---
Assigned To: Tomboy Maintainers
Tomboy Maintainers
: 155063 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-05-12 10:36 UTC by Mikkel Kamstrup Erlandsen
Modified: 2008-02-26 20:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tomboy-links.png (21.45 KB, image/png)
2007-09-07 09:03 UTC, Pacho Ramos
  Details
Filesystem link errors in Tomboy and using Nautilus (144.38 KB, image/png)
2008-01-15 06:29 UTC, Kalin Agrawal
  Details
URI-escape file paths so full links in notes will work. (684 bytes, patch)
2008-02-22 22:48 UTC, Boyd Timothy
committed Details | Review

Description Mikkel Kamstrup Erlandsen 2005-05-12 10:36:48 UTC
Please describe the problem:
If I drag  the folder "My Downloads" from Nautilus to Tomboy I get a link like
(html-notation for clarity)

<a href="/home/mikkel/My"> Downloads

If I manually type in the %20 escape sequence for the white space it works ok. Ie
typing /home/mikkel/My%20Downloads result in a working link
<a href="/home/mikkel/My Downloads">

Steps to reproduce:
1. Drag a folder which filename contains a white space to Tomboy
2. Observe
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Mikkel Kamstrup Erlandsen 2005-05-12 10:38:09 UTC
Argh! How do I make html escapes in Bugzilla? Testing:

<a href="/home/mikkel/My"> Downloads
<a href="/home/mikkel/My Downloads">

Comment 2 Mikkel Kamstrup Erlandsen 2005-05-12 11:01:07 UTC
Manually editing the relevant line in the note from

<link:url>/home/mikkel/My</link:url>  Downloads

to

<link:url>/home/mikkel/My Downloads</link:url>

also works. Maybe Tomboy should check whether the file exists before making
something a link. If then it discovers something that looks like a link but has
no corresponding file, it would try including the next whitespace separated
word, and if that was a file, make the text a link...

Example. I have the file "/home/mikkel/My Downloads". The parse would then go as
follows:
- /home/mikkel/My does not exists.
- Do nothing or indicate a broken link
- Attach the next word to the string and look for that file. Ie. look for
"/home/mikkel/My Downloads"
- If it exists, make it a link.

Problem: How many whitespaces should the parser dig down in search of an
existing file? 

Perhaps a scheme where it scans "ls /home/mikkel/My*" would be better. It almost
definitely would :)

Cheers!
Comment 3 Alex Graveley 2005-05-18 05:34:00 UTC
*** Bug 155063 has been marked as a duplicate of this bug. ***
Comment 4 jjvenkit 2006-09-26 15:07:51 UTC
this bug seems to be fixed for local files and folders in version 0.3.5 (in ubuntu 6.06).

however typing in urls with spaces in them or that end in brackets are not "linkified" properly.  for example:
http://dx.doi.org/10.1061/(ASCE)0733-9372(2005)131:3(336)

this is a valid url but when i type or paste it in to a tomboy note the final ")" is not linkified and thus the url doesn't work.  this is similar to the issue with spaces because it seems to fall back to tomboy needing a more nuanced or intelligent way of determining what characters are in and out.
Comment 5 Wouter Bolsterlee (uws) 2007-02-20 10:25:36 UTC
I assume that is because you won't be able to parenthesize urls otherwise, eg: Bugzilla (http://bugzilla.gnome.org/)
Comment 6 jjvenkit 2007-02-21 18:13:46 UTC
related to MKE's and UWS's comments, perhaps a reserved set of characters for links could be a solution. for example, if the link is within " and " or < and > then all the text, including spaces and parentheses would be included in the link. 

another option would be a button or right-click option that allowed the user to edit the actual link location and/or change the range of text that the link controls.  i'm thinking of how in html you can change the text in the href and between the a and /a and have them be the same (or different).  the text editor in wordpress does this and so do word processors.

if there is a work around for my ")" problem, i'm willing to try:
http://dx.doi.org/10.1061/(ASCE)0733-9372(2005)131:3(336)
Comment 7 Wouter Bolsterlee (uws) 2007-02-22 11:42:10 UTC
When dragging urls from nautilus to a Tomboy note, the inserted url could be simply escaped (eg. spaces to %20).
Comment 8 Boyd Timothy 2007-02-26 20:11:23 UTC
Dragging and dropping a link with a space it in works (I can click on the link in the note afterwards and the link opens properly).  So, this problem isn't too serious.  But, the user cannot modify the link manually and have the space/link be preserved correctly.  Let's readdress this later (after 0.6.0).
Comment 9 jjvenkit 2007-02-27 13:52:52 UTC
to get that final ) in my url, escaping the ) to %29 works.  it's ugly, but it works: http://dx.doi.org/10.1061/(ASCE)0733-9372(2005)131:3(336%29
Comment 10 Pacho Ramos 2007-09-07 09:00:26 UTC
Still valid with tomboy-0.6.3, also with local files linking

I attach a screenshot

Thanks a lot for trying to fix it :-)
Comment 11 Pacho Ramos 2007-09-07 09:03:32 UTC
Created attachment 95109 [details]
tomboy-links.png
Comment 12 ubuntu 2007-10-10 20:08:36 UTC
this issue is also present in 0.8.0...
this is a show stopper for my specific usage since I use the application to link notes to my research reading....


Drag and drop from nautilus should provide a preserved link and does not break after inserting a space or a line break after it.


:(

What is needed to get this bug changed to confirmed?
Comment 13 Kalin Agrawal 2008-01-15 06:29:10 UTC
Created attachment 102884 [details]
Filesystem link errors in Tomboy and using Nautilus

Screenshot of bugs and behavior with explanatory text captured in the Tomboy note itself.
Comment 14 Kalin Agrawal 2008-01-15 06:32:42 UTC
(In reply to comment #13)
> Created an attachment (id=102884) [edit]
> Filesystem link errors in Tomboy and using Nautilus
> 
> Screenshot of bugs and behavior with explanatory text captured in the Tomboy
> note itself.
> 

This bug occurs for me and makes this (potentially useful) aspect of Tomboy not consistently usable.

On my system, I recreate the bug in the following ways (below).  A detailed screenshot shows all the behavior I observed.  The path:
/home/kalin/Documents/This is all a directory name/This is a file name.txt
is a valid file with some saved text in it.  gedit is my default text editor.
Tomboy 0.8.0
Nautilus 2.20.0
GNU/Linux: Ubuntu 7.10 distribution
uname -a: Linux machname 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007 i686 GNU/Linux
Gnome


Manually typed:
/home/kalin - Works
/home/kalin/Documents/This is all a directory name - Error (Cannot open location)
/home/kalin/Documents/This%20is%20all%20a%20directory%20name - Works
/home/kalin/Documents/This%11is%11all%11a%11directory%11name - Correctly Errors, but incorrectly underlines the whole link (not valid, non-existent dir with that name).
/home/kalin/Documents/This%20is%20all%20a%20directory%20name/This%20is%20a%20file%20name.txt - Works, correct file is opened using gedit.

Select a file in Nautilus, "copy", "paste" into Tomboy:
/home/kalin/Documents/This is all a directory name/This is a file name.txt - Error (Cannot open location)

Mouse drag a file from Nautilus into Tomboy, then press <space> or <enter>
/home/kalin/Documents/This is all a directory name/This is a file name.txt - Error

Mouse drag a file into Tomboy, then press NOTHING AT ALL, but click with the mouse on it or somewhere else:
/home/kalin/Documents/This is all a directory name/This is a file name.txt
(This and the following text were typed before creating the link directly above)
If I do not press "space" or "Enter" or add any more text immediately following the above drag-and-dropped file name link, something peculiar happens: No error is reported, but gedit starts fresh with a blank, "Unsaved Document 1".  That is the file it points to was not actually opened.
Comment 15 Boyd Timothy 2008-02-22 22:48:13 UTC
Created attachment 105796 [details] [review]
URI-escape file paths so full links in notes will work.

Committed to SVN Trunk (r1883).
Comment 16 Pacho Ramos 2008-02-23 10:41:04 UTC
Thanks a lot :-)