diff lisp/gnus/shr.el @ 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 131f7940cd0f
children 733acab855e4
line wrap: on
line diff
--- 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))