comparison 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
comparison
equal deleted inserted replaced
111394:72d2a83a2641 111395:969fb8574065
549 ((or shr-inhibit-images 549 ((or shr-inhibit-images
550 (and shr-blocked-images 550 (and shr-blocked-images
551 (string-match shr-blocked-images url))) 551 (string-match shr-blocked-images url)))
552 (setq shr-start (point)) 552 (setq shr-start (point))
553 (let ((shr-state 'space)) 553 (let ((shr-state 'space))
554 (if (> (length alt) 8) 554 (if (> (string-width alt) 8)
555 (shr-insert (substring alt 0 8)) 555 (shr-insert (truncate-string-to-width alt 8))
556 (shr-insert alt)))) 556 (shr-insert alt))))
557 ((url-is-cached (shr-encode-url url)) 557 ((url-is-cached (shr-encode-url url))
558 (shr-put-image (shr-get-image-data url) alt)) 558 (shr-put-image (shr-get-image-data url) alt))
559 (t 559 (t
560 (insert alt) 560 (insert alt)