From: Lars Magne Ingebrigtsen Date: Sat, 21 Dec 2013 17:54:16 +0000 (+0100) Subject: * net/shr.el (shr--extract-best-source): Don't bug out on audio elements X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~271 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=073d5cfd9e1bdc5aafcae04b7a667e4b0c006922;p=emacs.git * net/shr.el (shr--extract-best-source): Don't bug out on audio elements That have text inside. Also remove debugging. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 53cd2430519..ea6579209ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-12-21 Lars Magne Ingebrigtsen + + * net/shr.el (shr--extract-best-source): Don't bug out on audio + elements with text inside. Also remove debugging. + 2013-12-21 Jan Djärv * cus-start.el (all): Add ns-use-srgb-colorspace. 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)