diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/net/shr.el | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b7e338e187..f17cbb7441f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * net/shr.el (shr-generic): Make into a defsubst to make the stack | 3 | * net/shr.el (shr-generic): Make into a defsubst to make the stack |
| 4 | depth shallower (bug#16587). | 4 | depth shallower (bug#16587). |
| 5 | (shr-tag-svg): Respect `shr-inhibit-images'. | ||
| 6 | (shr-dom-to-xml): Respect `shr-blocked-images' (bug#15882). | ||
| 5 | 7 | ||
| 6 | 2014-01-31 Dmitry Gutov <dgutov@yandex.ru> | 8 | 2014-01-31 Dmitry Gutov <dgutov@yandex.ru> |
| 7 | 9 | ||
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index dba0f71bfe1..f23faaa3437 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -972,11 +972,18 @@ ones, in case fg and bg are nil." | |||
| 972 | (defun shr-dom-to-xml (dom) | 972 | (defun shr-dom-to-xml (dom) |
| 973 | "Convert DOM into a string containing the xml representation." | 973 | "Convert DOM into a string containing the xml representation." |
| 974 | (let ((arg " ") | 974 | (let ((arg " ") |
| 975 | (text "")) | 975 | (text "") |
| 976 | url) | ||
| 976 | (dolist (sub (cdr dom)) | 977 | (dolist (sub (cdr dom)) |
| 977 | (cond | 978 | (cond |
| 978 | ((listp (cdr sub)) | 979 | ((listp (cdr sub)) |
| 979 | (setq text (concat text (shr-dom-to-xml sub)))) | 980 | ;; Ignore external image definitions if required. |
| 981 | ;; <image xlink:href="http://TRACKING_URL/"/> | ||
| 982 | (when (or (not (eq (car sub) 'image)) | ||
| 983 | (not (setq url (cdr (assq ':xlink:href (cdr sub))))) | ||
| 984 | (not shr-blocked-images) | ||
| 985 | (not (string-match shr-blocked-images url))) | ||
| 986 | (setq text (concat text (shr-dom-to-xml sub))))) | ||
| 980 | ((eq (car sub) 'text) | 987 | ((eq (car sub) 'text) |
| 981 | (setq text (concat text (cdr sub)))) | 988 | (setq text (concat text (cdr sub)))) |
| 982 | (t | 989 | (t |
| @@ -990,7 +997,8 @@ ones, in case fg and bg are nil." | |||
| 990 | (car dom)))) | 997 | (car dom)))) |
| 991 | 998 | ||
| 992 | (defun shr-tag-svg (cont) | 999 | (defun shr-tag-svg (cont) |
| 993 | (when (image-type-available-p 'svg) | 1000 | (when (and (image-type-available-p 'svg) |
| 1001 | (not shr-inhibit-images)) | ||
| 994 | (funcall shr-put-image-function | 1002 | (funcall shr-put-image-function |
| 995 | (shr-dom-to-xml (cons 'svg cont)) | 1003 | (shr-dom-to-xml (cons 'svg cont)) |
| 996 | "SVG Image"))) | 1004 | "SVG Image"))) |