emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c3ea511: Make inline SVGs work in shr again


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master c3ea511: Make inline SVGs work in shr again
Date: Tue, 09 Dec 2014 04:18:19 +0000

branch: master
commit c3ea511964facdd86cc41c15f352e995a8061820
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    Make inline SVGs work in shr again
    
    * net/shr.el (shr-dom-print): Don't print comments.
    (shr-tag-svg): Give inline SVG images the right type.
---
 lisp/ChangeLog  |    3 +++
 lisp/net/shr.el |    5 ++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e2dbe92..54ada6e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2014-12-09  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * net/shr.el (shr-dom-print): Don't print comments.
+       (shr-tag-svg): Give inline SVG images the right type.
+
        * net/eww.el (eww-update-header-line-format): Mark valid/invalid
        certificates in the header line.
        (eww-invalid-certificate, eww-valid-certificate): New faces.
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index e23fd0b..186c9f5 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1019,6 +1019,8 @@ ones, in case fg and bg are nil."
       (cond
        ((stringp elem)
        (insert elem))
+       ((eq (dom-tag elem) 'comment)
+       )
        ((or (not (eq (dom-tag elem) 'image))
            ;; Filter out blocked elements inside the SVG image.
            (not (setq url (dom-attr elem ':xlink:href)))
@@ -1031,7 +1033,8 @@ ones, in case fg and bg are nil."
 (defun shr-tag-svg (dom)
   (when (and (image-type-available-p 'svg)
             (not shr-inhibit-images))
-    (funcall shr-put-image-function (shr-dom-to-xml dom) "SVG Image")))
+    (funcall shr-put-image-function (list (shr-dom-to-xml dom) 'image/svg+xml)
+            "SVG Image")))
 
 (defun shr-tag-sup (dom)
   (let ((start (point)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]