]> code.delx.au - gnu-emacs/commitdiff
shr-dom-print dom.el changes
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 1 Dec 2014 19:17:39 +0000 (20:17 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 1 Dec 2014 19:18:15 +0000 (20:18 +0100)
* net/shr.el (shr-dom-print): Fix up `shr-dom-print' after the
dom.el changes.

lisp/ChangeLog
lisp/net/shr.el

index 481bd1505028c5abceefc5dec960036f5bf3a692..762b2489f91d85af961f953117d3f16185a86133 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * net/shr.el (shr-dom-print): Fix up `shr-dom-print' after the
+       dom.el changes.
+
 2014-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * vc/vc.el (vc-find-conflicted-file): Look for conflicted files in the
index f44ecc2bdd3a5219b49941f93d4d73a7647fbac3..3ad8bd177777b8758b4ff3cc0a94096f818da5de 100644 (file)
@@ -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 "</%s>" (dom-tag dom))))
 
 (defun shr-tag-svg (dom)