[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master dd91362: * lisp/net/shr.el (shr--preferred-image):
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] master dd91362: * lisp/net/shr.el (shr--preferred-image): Ignore whitespace (bug#24893). |
Date: |
Fri, 11 Nov 2016 00:28:02 +0000 (UTC) |
branch: master
commit dd913625652d8e94c74a00095262c7105e728a5e
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>
* lisp/net/shr.el (shr--preferred-image): Ignore whitespace (bug#24893).
---
lisp/net/shr.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 73886bf..ff1fab8 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master dd91362: * lisp/net/shr.el (shr--preferred-image): Ignore whitespace (bug#24893).,
Katsumi Yamaoka <=