emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master b08f8bb: Render application/xhtml+xml as HTML


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master b08f8bb: Render application/xhtml+xml as HTML
Date: Thu, 05 Mar 2015 22:26:45 +0000

branch: master
commit b08f8bb06a012b46cb932762b002a48c6efe5396
Author: Ivan Shmakov <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    Render application/xhtml+xml as HTML
    
    Fixes: debbugs:20009
    
    * lisp/net/eww.el (eww-html-p): New function.
    (eww-render): Use it.
---
 lisp/ChangeLog  |    5 +++++
 lisp/net/eww.el |   11 ++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ef010d4..0f905e6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-05  Ivan Shmakov  <address@hidden>
+
+       * net/eww.el (eww-html-p): New function (bug#20009).
+       (eww-render): Use it.
+
 2015-03-05  Artur Malabarba  <address@hidden>
 
        * desktop.el (desktop-buffer-info): Write docstring.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 577cd41..a128ffb 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -306,6 +306,12 @@ See the `eww-search-prefix' variable for the search engine 
used."
   (interactive "r")
   (eww (buffer-substring beg end)))
 
+(defun eww-html-p (content-type)
+  "Return non-nil if CONTENT-TYPE designates an HTML content type.
+Currently this means either text/html or application/xhtml+xml."
+  (member content-type '("text/html"
+                        "application/xhtml+xml")))
+
 (defun eww-render (status url &optional point buffer encode)
   (let ((redirect (plist-get status :redirect)))
     (when redirect
@@ -318,8 +324,7 @@ See the `eww-search-prefix' variable for the search engine 
used."
         (charset (intern
                   (downcase
                    (or (cdr (assq 'charset (cdr content-type)))
-                       (eww-detect-charset (equal (car content-type)
-                                                  "text/html"))
+                       (eww-detect-charset (eww-html-p (car content-type)))
                        "utf-8"))))
         (data-buffer (current-buffer)))
     ;; Save the https peer status.
@@ -332,7 +337,7 @@ See the `eww-search-prefix' variable for the search engine 
used."
                  (string-match-p eww-use-external-browser-for-content-type
                                  (car content-type)))
             (eww-browse-with-external-browser url))
-          ((equal (car content-type) "text/html")
+          ((eww-html-p (car content-type))
            (eww-display-html charset url nil point buffer encode))
           ((equal (car content-type) "application/pdf")
            (eww-display-pdf))



reply via email to

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