emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r118267: Fix `eww-display-html' bug when passed an e


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r118267: Fix `eww-display-html' bug when passed an explicit DOM
Date: Mon, 03 Nov 2014 00:30:45 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118267
revision-id: address@hidden
parent: address@hidden
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Mon 2014-11-03 01:30:41 +0100
message:
  Fix `eww-display-html' bug when passed an explicit DOM
  
  (eww-display-html): Don't try to decode the text if we've been
  passed in a pre-parsed DOM.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/eww.el                eww.el-20130610114603-80ap3gwnw4x4m5ix-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-03 00:24:33 +0000
+++ b/lisp/ChangeLog    2014-11-03 00:30:41 +0000
@@ -5,6 +5,8 @@
        (eww-readable): Decode the saved text correctly.
        (eww-readable): Save the history before displaying so that we can
        go back to the non-readable version.
+       (eww-display-html): Don't try to decode the text if we've been
+       passed in a pre-parsed DOM.
 
 2014-11-02  Lars Magne Ingebrigtsen  <address@hidden>
 

=== modified file 'lisp/net/eww.el'
--- a/lisp/net/eww.el   2014-11-03 00:24:33 +0000
+++ b/lisp/net/eww.el   2014-11-03 00:30:41 +0000
@@ -256,16 +256,18 @@
 (defun eww-display-html (charset url &optional document point)
   (or (fboundp 'libxml-parse-html-region)
       (error "This function requires Emacs to be compiled with libxml2"))
-  (unless (eq charset 'utf-8)
-    (condition-case nil
-       (decode-coding-region (point) (point-max) charset)
-      (coding-system-error nil)))
   (let ((document
         (or document
             (list
              'base (list (cons 'href url))
-             (libxml-parse-html-region (point) (point-max)))))
-       (source (buffer-substring (point) (point-max))))
+             (progn
+               (unless (eq charset 'utf-8)
+                 (condition-case nil
+                     (decode-coding-region (point) (point-max) charset)
+                   (coding-system-error nil)))
+               (libxml-parse-html-region (point) (point-max))))))
+       (source (and (null document)
+                    (buffer-substring (point) (point-max)))))
     (eww-setup-buffer)
     (setq eww-current-source source
          eww-current-dom document)


reply via email to

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