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 561456 - ExportToHtml cannot export note with a URL that contains a wiki-word
ExportToHtml cannot export note with a URL that contains a wiki-word
Status: RESOLVED NOTGNOME
Product: tomboy
Classification: Applications
Component: General
0.13.x
Other All
: Normal normal
: 1.4.0
Assigned To: Tomboy Maintainers
Tomboy Maintainers
gnome[moved-to-github]
Depends on:
Blocks:
 
 
Reported: 2008-11-19 02:03 UTC by Gregory Mazzola
Modified: 2017-07-31 12:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Fixes the XSL stylesheet (444 bytes, patch)
2008-11-19 02:10 UTC, Gregory Mazzola
rejected Details | Review

Description Gregory Mazzola 2008-11-19 02:03:31 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.
Comment 1 Gregory Mazzola 2008-11-19 02:10:08 UTC
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?
Comment 2 Florian Pinault 2009-04-14 17:57:33 UTC
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...

Comment 3 Benjamin Podszun 2010-08-16 11:56:16 UTC
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)?
Comment 4 Benjamin Podszun 2010-08-16 16:48:29 UTC
Still the case.. WikiWords were disabled for me..
Comment 5 Aaron D Borden 2011-06-10 21:45:24 UTC
Confirmed patch 189681 on bug 627060 resolves the issue.
Comment 6 Alemann Massho 2012-05-12 19:04:32 UTC
I can confirm this fixed by http://git.gnome.org/browse/tomboy/commit/?id=77dc2ab38bed, notes exported to html look correct.
Comment 7 André Klapper 2017-07-31 12:43:50 UTC
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.