GNOME Bugzilla – Bug 561456
ExportToHtml cannot export note with a URL that contains a wiki-word
Last modified: 2017-07-31 12:43:50 UTC
Please describe the problem: If I create a note with a URL containing a wiki-word, and then export said note to HTML, the export does not properly format the URL. Example: 1. Create a note that says "Hello /etc/NetworkManager/dispatch.d world" in it. 2. Export the note to HTML. 3. Open the note. Firefox displays the following text: "Hello /etc//dispatcher.d world" The HTML generated is as follows: <div class="note" id="New Note 24"><a name="#New Note 24"></a><h1>New Note 24</h1><a style="color:#3465A4" href="%0A"> </a>Hello<a style="color:#3465A4" href=" /etc/"> /etc/</a><a style="color:#3465A4" href="/dispatcher.d">/dispatcher.d</a> world</div> As you can see, NetworkManager is a wiki-word and it is entirely blanked out. Steps to reproduce: See above. Actual results: See above. Expected results: I expect the following HTML to be printed: <a href="/etc/NetworkManager/dispatch.d">/etc/NetworkManager/dispatch.d</a> Does this happen every time? Yes. Other information: N/A.
Created attachment 122998 [details] [review] Fixes the XSL stylesheet This patch is a partial fix: the exported page now displays "/etc/NetworkManager/dispatch.d". However, the HTML code is wrong: Hello<a style="color:#3465A4" href="/etc/NetworkManager"> /etc/NetworkManager</a><a style="color:#3465A4" href="/dispatcher.d">/dispatcher.d</a> world Notice that there are two links. The odd thing is, the XSL stylesheet is behaving perfectly. If you look at the .note file, there are two links there as well: Hello<link:url> /etc/<link:broken>NetworkManager</link:broken></link:url><link:url>/dispatcher.d</link:url> world Anyone care to help, or point me in the right direction?
I confirm this bug (using rev 2448). > point me in the right direction? I am not an expert, but I believe a first solution would be as following : in Watchers.cs, NoteWikiWatcher::ApplyWikiwordToBlock this line applies the tag : 957: Buffer.ApplyTag (broken_link_tag, start_cpy, end); but the tag shouldn't be applied if the text is inside an url. So we need to add a test : if (not (TestIfInsideATag("link:url"))) function TestIfInsideATag doesn't exist, but I would look in NoteBuffer.cs:179 IsActiveTag. A second solution may be to keep the wiki tag in the .note xml and adapt the xsl : template for <link:url> write value of "./text()" and "./link:broken/text()" nodes in the right order. variable x = next <link:url> sibbling. apply this template to x if there is no other node between "." and x end Keep me posted if that helps or if you need clarification...
1.5 years old, but I cannot reproduce it with the latest source (on Windows right now, though). This is the resulting html: <div class="note" id="New Note 4"><a name="new note 4"></a><h1>New Note 4</h1> Hello <a style="color:#3465A4" href="/etc/NetworkManager/dispatch.d">/etc/NetworkManager/dispatch.d</a> world</div> Am I missing a plugin? Can someone still reproduce this (will try on Linux myself asap)?
Still the case.. WikiWords were disabled for me..
Confirmed patch 189681 on bug 627060 resolves the issue.
I can confirm this fixed by http://git.gnome.org/browse/tomboy/commit/?id=77dc2ab38bed, notes exported to html look correct.
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.