From: Lars Magne Ingebrigtsen Date: Mon, 1 Dec 2014 19:17:39 +0000 (+0100) Subject: shr-dom-print dom.el changes X-Git-Tag: emacs-25.0.90~2635^2~238 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6d80f26a9ae8e43973dbc946a9c070192fd5c431;p=emacs.git shr-dom-print dom.el changes * net/shr.el (shr-dom-print): Fix up `shr-dom-print' after the dom.el changes. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 481bd150502..762b2489f91 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-01 Lars Magne Ingebrigtsen + + * net/shr.el (shr-dom-print): Fix up `shr-dom-print' after the + dom.el changes. + 2014-12-01 Stefan Monnier * vc/vc.el (vc-find-conflicted-file): Look for conflicted files in the diff --git a/lisp/net/shr.el b/lisp/net/shr.el index f44ecc2bdd3..3ad8bd17777 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1009,18 +1009,23 @@ ones, in case fg and bg are nil." "Convert DOM into a string containing the xml representation." (insert (format "<%s" (dom-tag dom))) (dolist (attr (dom-attributes dom)) - ;; Ignore attributes that start with a colon. + ;; Ignore attributes that start with a colon because they are + ;; private elements. (unless (= (aref (format "%s" (car attr)) 0) ?:) (insert (format " %s=\"%s\"" (car attr) (cdr attr))))) (insert ">") (let (url) (dolist (elem (dom-children dom)) - (when (or (not (eq (dom-tag elem) 'image)) - (not (setq url (dom-attr elem ':xlink:href))) - (not shr-blocked-images) - (not (string-match shr-blocked-images url))) + (cond + ((stringp elem) + (insert elem)) + ((or (not (eq (dom-tag elem) 'image)) + ;; Filter out blocked elements inside the SVG image. + (not (setq url (dom-attr elem ':xlink:href))) + (not shr-blocked-images) + (not (string-match shr-blocked-images url))) (insert " ") - (shr-dom-print elem)))) + (shr-dom-print elem))))) (insert (format "" (dom-tag dom)))) (defun shr-tag-svg (dom)