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 360586 - &amp in a label with markup enable saves as an &
&amp in a label with markup enable saves as an &
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
3.0.x
Other All
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-10-08 09:43 UTC by Will Erickson
Modified: 2011-10-12 08:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple patch (679 bytes, patch)
2006-11-02 19:58 UTC, Juan Pablo Ugarte
committed Details | Review

Description Will Erickson 2006-10-08 09:43:55 UTC
Please describe the problem:
When saving a glade file with a label containing the following text <span weight="bold" size="x-small">&amp;</span>, the saved result is <span weight="bold" size="x-small">&</span>

Steps to reproduce:
1. Create a Label
2. Set text to <span weight="bold" size="x-small">&amp;</span>
3. Toggle "Use Markup" button
4. Save glade file
5. Load glade file
6. View Label text
7. Notice how label text is now <span weight="bold" size="x-small">&</span>


Actual results:
The label contains <span weight="bold" size="x-small">&</span>

Expected results:
The label should contain <span weight="bold" size="x-small">&amp;</span>

Does this happen every time?
Yes

Other information:
Comment 1 Juan Pablo Ugarte 2006-11-02 19:58:21 UTC
Created attachment 75885 [details] [review]
Simple patch

hmm, well this patch escape every string before saving it to the xml file.
Comment 2 Juan Pablo Ugarte 2006-11-07 15:40:56 UTC
aplyed in cvs
Comment 3 Will Erickson 2006-12-12 10:04:45 UTC
I just checked the CVS version, and this patch was not applied to CVS even though it does solve hte problem I described above
Comment 4 Tristan Van Berkom 2006-12-12 14:55:17 UTC
Will, sorry the report was not so clear, this fix was actually
applied to the stable branch (glade3-3-0-branch), I have another
fresh patch against the stable branch and I plan to make one
final 3.0 release, that should be in the next couple of days.

At that point I will merge in the remaining 'stable' development
into HEAD and completely drop 'stable' (hopefully :D )
Comment 5 Jeff Westerinen 2007-01-16 22:31:52 UTC
This bug needs to be reopened.  An additional problem was discovered as follows:

Description:
Set the property “Use Markup” to “yes” on a label and the “&” still can’t be set on label.

The warning:
(alp-glade:31685): Gtk-WARNING **: Failed to set label from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as &amp;

I am unable to reopen this bug, due to lack of priveleges.  I am posting this comment in hopes that some with proper proveleges will reopen it for me.
Comment 6 Tristan Van Berkom 2007-01-17 03:31:48 UTC
reopening bug.
Comment 7 Tristan Van Berkom 2007-01-21 05:56:06 UTC
that patch had been committed a long time ago, just triaging it.
Comment 8 Tristan Van Berkom 2011-10-12 08:36:10 UTC
Thankfully this was finally fixed properly in bug 654609.

The thing about the use markup property is that you are going
to have to manually escape the label text in any case.

The label text is the text that is going to be applied to the
widget, if the widget has use markup, then the text needs to
be escaped for xml special chars.