mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
* lisp/net/shr.el (shr--preferred-image): Ignore whitespace (bug#24893).
This commit is contained in:
parent
2bb02a3782
commit
dd91362565
1 changed files with 4 additions and 2 deletions
|
|
@ -1529,7 +1529,7 @@ The preference is a float determined from `shr-prefer-media-type'."
|
|||
(setq srcset
|
||||
(sort (mapcar
|
||||
(lambda (elem)
|
||||
(let ((spec (split-string elem " ")))
|
||||
(let ((spec (split-string elem "[\t\n ]+")))
|
||||
(cond
|
||||
((= (length spec) 1)
|
||||
;; Make sure it's well formed.
|
||||
|
|
@ -1543,7 +1543,9 @@ The preference is a float determined from `shr-prefer-media-type'."
|
|||
(t
|
||||
(list (car spec)
|
||||
(string-to-number (cadr spec)))))))
|
||||
(split-string srcset ", "))
|
||||
(split-string (replace-regexp-in-string
|
||||
"\\`[\t\n ]+\\|[\t\n ]+\\'" "" srcset)
|
||||
"[\t\n ]*,[\t\n ]*"))
|
||||
(lambda (e1 e2)
|
||||
(> (cadr e1) (cadr e2)))))
|
||||
;; Choose the smallest picture that's bigger than the current
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue