From b354bc5303712b3fc7a0b9837c8f2483b80b722d Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Thu, 4 Nov 2010 11:00:25 +0000 Subject: [PATCH] shr.el (shr-tag-img): Use string-width and truncate-string-to-width to measure the length and truncate alt text. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/shr.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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)) -- 2.39.5