From: Katsumi Yamaoka Date: Thu, 4 Nov 2010 11:00:25 +0000 (+0000) Subject: shr.el (shr-tag-img): Use string-width and truncate-string-to-width to measure the... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~388 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b354bc5303712b3fc7a0b9837c8f2483b80b722d;p=emacs.git shr.el (shr-tag-img): Use string-width and truncate-string-to-width to measure the length and truncate alt text. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 43ec85c8879..aff887fb770 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-11-04 Katsumi Yamaoka + + * 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 * nndiary.el (nndiary-generate-nov-databases-1) diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index cc3855bed04..5614e72f518 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -551,8 +551,8 @@ Return a string with image data." (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))