GNOME Bugzilla – Bug 505478
add possibility to specify markup for text buffers with tags
Last modified: 2015-03-18 03:27:39 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.
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 ;-)
we have a function to load pango markup now