diff options
author | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2013-12-21 18:54:16 +0100 |
---|---|---|
committer | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2013-12-21 18:54:16 +0100 |
commit | 073d5cfd9e1bdc5aafcae04b7a667e4b0c006922 (patch) | |
tree | 65680d7899e7aa1142594e96026f71370d33f181 /lisp/net | |
parent | df8b4c35120bcde0ce0b0f39e221033fdde7cd56 (diff) | |
download | emacs-073d5cfd9e1bdc5aafcae04b7a667e4b0c006922.tar.gz |
* net/shr.el (shr--extract-best-source): Don't bug out on audio elements
That have text inside. Also remove debugging.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/shr.el | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 4b67bafc5cd..5c30bd8ac67 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1136,21 +1136,16 @@ The preference is a float determined from `shr-prefer-media-type'." (setq pref (or pref -1.0)) (let (new-pref) (dolist (elem cont) - (when (and (listp elem) - (not (keywordp (car elem)))) ;; skip attributes - (when (and (eq (car elem) 'source) - (< pref - (setq new-pref - (shr--get-media-pref elem)))) - (setq pref new-pref - url (cdr (assq :src elem))) - (message "new %s %s" url pref)) + (when (and (eq (car elem) 'source) + (< pref + (setq new-pref + (shr--get-media-pref elem)))) + (setq pref new-pref + url (cdr (assq :src elem))) ;; libxml's html parser isn't HTML5 compliant and non terminated ;; source tags might end up as children. So recursion it is... (dolist (child (cdr elem)) - (when (and (listp child) - (not (keywordp (car child))) ;; skip attributes - (eq (car child) 'source)) + (when (eq (car child) 'source) (let ((ret (shr--extract-best-source (list child) url pref))) (when (< pref (cdr ret)) (setq url (car ret) |