--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -300,6 +284,12 @@
   (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."
+  (string-match-p "^\\(text\\|application\\)/\\(html\\|xhtml\\+xml\\)$"
+		  content-type))
+
 (defun eww-render (status url &optional point buffer encode)
   (let ((redirect (plist-get status :redirect)))
     (when redirect
@@ -318,8 +308,7 @@ defun eww-render (status url &optional point buffer encode)
 	 (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 +321,7 @@ defun eww-render (status url &optional point buffer encode)
                  (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))
