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 505478 - add possibility to specify markup for text buffers with tags
add possibility to specify markup for text buffers with tags
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-12-24 20:31 UTC by Paul Pogonyshev
Modified: 2015-03-18 03:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Pogonyshev 2007-12-24 20:31:35 UTC
It would be nice to have smth. like gtk_text_buffer_insert_markup(), to where you could pass string like:

    See <article>Sepulka</article> for more information on <abbr>SLK</abbr>.

where 'article' and 'abbr' are tags defined in gtk_text_buffer_get_tag_table().  I.e., it would be a simple addition, not requiring any standard tags injected by GTK+.  All tags must be defined by user, just as for gtk_text_buffer_insert_with_tags_by_name().

I'm willing to write a patch if such functionality is approved in principle.

Things not clear are tags with funny characters in name (e.g. tag named 'x < y statement').  One simple and clean solution would be that tags with such names simply can't be inserted with such a function.  I.e. there will no be additional restrictions on tag names, tags with certain names will not be accessible to this new function.

Function name can be different too, to avoid name conflict with GMarkup, since this proposed function accepts something similar, but not really GMarkup.
Comment 1 Havoc Pennington 2008-06-21 17:53:32 UTC
See also discussion on #59390 - I like this idea more than the ones on that bug, though. It's a lot less complex.

Maybe would not call it insert_markup(), since that might imply it's Pango markup. But then, I'm not sure what else to call it.

I'm not a gtk maintainer so don't take this as approving in principle ;-)
Comment 2 Matthias Clasen 2015-03-18 03:27:39 UTC
we have a function to load pango markup now