Mercurial > emacs
changeset 111395:969fb8574065
shr.el (shr-tag-img): Use string-width and truncate-string-to-width to measure the length and truncate alt text.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 04 Nov 2010 11:00:25 +0000 |
parents | 72d2a83a2641 |
children | 641138a273eb |
files | lisp/gnus/ChangeLog lisp/gnus/shr.el |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog Wed Nov 03 19:21:51 2010 -0400 +++ b/lisp/gnus/ChangeLog Thu Nov 04 11:00:25 2010 +0000 @@ -1,3 +1,8 @@ +2010-11-04 Katsumi Yamaoka <yamaoka@jpl.org> + + * shr.el (shr-tag-img): Use string-width and truncate-string-to-width + to measure the length and truncate alt text. + 2010-11-03 Glenn Morris <rgm@gnu.org> * nndiary.el (nndiary-generate-nov-databases-1)
--- a/lisp/gnus/shr.el Wed Nov 03 19:21:51 2010 -0400 +++ b/lisp/gnus/shr.el Thu Nov 04 11:00:25 2010 +0000 @@ -551,8 +551,8 @@ (string-match shr-blocked-images url))) (setq shr-start (point)) (let ((shr-state 'space)) - (if (> (length alt) 8) - (shr-insert (substring alt 0 8)) + (if (> (string-width alt) 8) + (shr-insert (truncate-string-to-width alt 8)) (shr-insert alt)))) ((url-is-cached (shr-encode-url url)) (shr-put-image (shr-get-image-data url) alt))