[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116226: Make shr respect privacy when viewing docum
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] trunk r116226: Make shr respect privacy when viewing documents with SVG images |
Date: |
Fri, 31 Jan 2014 21:45:13 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116226
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15882
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Fri 2014-01-31 13:44:11 -0800
message:
Make shr respect privacy when viewing documents with SVG images
(shr-tag-svg): Respect `shr-inhibit-images'.
(shr-dom-to-xml): Respect `shr-blocked-images'.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/net/shr.el shr.el-20101002102929-yfzewk55rsg0mn93-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-01-31 21:08:13 +0000
+++ b/lisp/ChangeLog 2014-01-31 21:44:11 +0000
@@ -2,6 +2,8 @@
* net/shr.el (shr-generic): Make into a defsubst to make the stack
depth shallower (bug#16587).
+ (shr-tag-svg): Respect `shr-inhibit-images'.
+ (shr-dom-to-xml): Respect `shr-blocked-images' (bug#15882).
2014-01-31 Dmitry Gutov <address@hidden>
=== modified file 'lisp/net/shr.el'
--- a/lisp/net/shr.el 2014-01-31 21:08:13 +0000
+++ b/lisp/net/shr.el 2014-01-31 21:44:11 +0000
@@ -972,11 +972,18 @@
(defun shr-dom-to-xml (dom)
"Convert DOM into a string containing the xml representation."
(let ((arg " ")
- (text ""))
+ (text "")
+ url)
(dolist (sub (cdr dom))
(cond
((listp (cdr sub))
- (setq text (concat text (shr-dom-to-xml sub))))
+ ;; Ignore external image definitions if required.
+ ;; <image xlink:href="http://TRACKING_URL/"/>
+ (when (or (not (eq (car sub) 'image))
+ (not (setq url (cdr (assq ':xlink:href (cdr sub)))))
+ (not shr-blocked-images)
+ (not (string-match shr-blocked-images url)))
+ (setq text (concat text (shr-dom-to-xml sub)))))
((eq (car sub) 'text)
(setq text (concat text (cdr sub))))
(t
@@ -990,7 +997,8 @@
(car dom))))
(defun shr-tag-svg (cont)
- (when (image-type-available-p 'svg)
+ (when (and (image-type-available-p 'svg)
+ (not shr-inhibit-images))
(funcall shr-put-image-function
(shr-dom-to-xml (cons 'svg cont))
"SVG Image")))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116226: Make shr respect privacy when viewing documents with SVG images,
Lars Ingebrigtsen <=