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 489452 - ampersand entity in links is not converted to ampersand
ampersand entity in links is not converted to ampersand
Status: RESOLVED DUPLICATE of bug 485700
Product: GtkHtml
Classification: Other
Component: Rendering
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtkhtml-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2007-10-23 15:54 UTC by Frederic Peters
Modified: 2007-10-24 15:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
inspect for entity (2.71 KB, patch)
2007-10-23 20:55 UTC, Frederic Peters
rejected Details | Review

Description Frederic Peters 2007-10-23 15:54:06 UTC
<html>
<body>
<a href="http://www.example.com/?b&amp;c">b&amp;c</a>
</body>
</html>

Expected results:

 - would display a link with b&c as content
 - clicking on it would bring http://www.example.com/?b&c

Actual results:

 - display a link with b&amp;c as content
 - clicking on it brings http://www.example.com/?b&amp;c

Note ampersand entities in other document parts are correctly displayed.  Even more surprising the link content is displayed correctly if the <a> tag doesn't include a href attribute.
Comment 1 Frederic Peters 2007-10-23 17:22:25 UTC
It is caused by the fix applied to bug 270487.
Comment 2 Frederic Peters 2007-10-23 20:55:53 UTC
Created attachment 97755 [details] [review]
inspect for entity

Look further in the string when determining the token will be handled as an HTML entity; also remove special casing for links added as a fix to bug 270487 since it is no longer necessary.
Comment 3 Milan Crha 2007-10-24 08:38:29 UTC
I cannot find it now, but I saw somewhere a "rule" to always escape amps in urls, even in href attribute. Which means, when user enters url
http://a.b.c/e?f=g&h=i
in a composer, then in HTML mail in href should be
http://a.b.c/e?f=g&amp;h=i
which your patch doesn't do. Anyway, there is previous bug about same issue, so marking this as duplicate.

btw, you've right it caused bug you mentioned, but I think we can leave it there, only improve a bit other logic.

*** This bug has been marked as a duplicate of 485700 ***
Comment 4 Frederic Peters 2007-10-24 13:58:03 UTC
I don't see how the patch attached to bug 485700 will fix the first problem I noted, " - would display a link with b&c as content".  Note the actual bug is not just about "&amp;" but with all entities; they are kept as is when used in a <a href="whatever"> tag.

I am only concerned about the rendering part, which that other patch doesn't fix.

Easy test:

<html><body><a href="http://whatever">a&nbsp;b</a></body></html>

Will render as a link with a&nbsp;b as text content with that other patch.
Comment 5 Milan Crha 2007-10-24 15:28:28 UTC
Thanks for testing, I uploaded new version of the patch, which fixes it.
BTW, we should discuss any issues about that patch rather in that opened bug.