# HG changeset patch
# User dmitry.petroff@gmail.com
# Date 1245622634 0
# Node ID 54de7746e14897fa1e84ebb106f2a7cb73a708fe
# Parent 77cfaae36918359aaf2345fc246972eaf242013f
Transform id-less tags to links using src and alt attributes.
Closes #8628.
committer: Paul Aurich
diff -r 77cfaae36918 -r 54de7746e148 COPYRIGHT
--- a/COPYRIGHT Sun Jun 21 21:26:59 2009 +0000
+++ b/COPYRIGHT Sun Jun 21 22:17:14 2009 +0000
@@ -332,6 +332,7 @@
Luke Petre
Diego Petten
Nathan Peterson
+Dmitry Petroff
Sebastián E. Peyrott
Andrea Piccinelli
Celso Pinto
diff -r 77cfaae36918 -r 54de7746e148 ChangeLog
--- a/ChangeLog Sun Jun 21 21:26:59 2009 +0000
+++ b/ChangeLog Sun Jun 21 22:17:14 2009 +0000
@@ -94,6 +94,8 @@
* Support saving animated custom smileys as animated images or animated
custom smileys. (Andrea Piccinelli)
* Support for keyboard navigation on the status icon. (Li Yuan)
+ * IMG tags without 'id' attributes are turned into links to the image URL.
+ (Dmitry Petroff)
Finch:
* The hardware cursor is updated correctly. This will be useful
diff -r 77cfaae36918 -r 54de7746e148 pidgin/gtkimhtml.c
--- a/pidgin/gtkimhtml.c Sun Jun 21 21:26:59 2009 +0000
+++ b/pidgin/gtkimhtml.c Sun Jun 21 22:17:14 2009 +0000
@@ -2996,10 +2996,21 @@
break;
id = gtk_imhtml_get_html_opt(tag, "ID=");
- if (!id)
- break;
- gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter);
- g_free(id);
+ if (id) {
+ gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter);
+ g_free(id);
+ } else {
+ char *src, *alt;
+ src = gtk_imhtml_get_html_opt(tag, "SRC=");
+ alt = gtk_imhtml_get_html_opt(tag, "ALT=");
+ if (src) {
+ gtk_imhtml_toggle_link(imhtml, src);
+ gtk_text_buffer_insert(imhtml->text_buffer, iter, alt ? alt : src, -1);
+ gtk_imhtml_toggle_link(imhtml, NULL);
+ }
+ g_free (src);
+ g_free (alt);
+ }
break;
}
case 47: /* P (opt) */