[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 6d80f26: shr-dom-print dom.el changes
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 6d80f26: shr-dom-print dom.el changes |
Date: |
Mon, 01 Dec 2014 19:18:28 +0000 |
branch: master
commit 6d80f26a9ae8e43973dbc946a9c070192fd5c431
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>
shr-dom-print dom.el changes
* net/shr.el (shr-dom-print): Fix up `shr-dom-print' after the
dom.el changes.
---
lisp/ChangeLog | 5 +++++
lisp/net/shr.el | 17 +++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 481bd15..762b248 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-01 Lars Magne Ingebrigtsen <address@hidden>
+
+ * net/shr.el (shr-dom-print): Fix up `shr-dom-print' after the
+ dom.el changes.
+
2014-12-01 Stefan Monnier <address@hidden>
* 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 f44ecc2..3ad8bd1 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 "</%s>" (dom-tag dom))))
(defun shr-tag-svg (dom)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 6d80f26: shr-dom-print dom.el changes,
Lars Ingebrigtsen <=