emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 b1a3ebe: Fix display of <pre> elements


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] emacs-25 b1a3ebe: Fix display of <pre> elements
Date: Tue, 16 Feb 2016 06:39:50 +0000

branch: emacs-25
commit b1a3ebedba88689d26f44cf7db338104b849ae99
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix display of <pre> elements
    
    * lisp/net/eww.el (eww-display-html): Remove CRLF before
    parsing so that <pre> elements don't render with ^M at the end
    of the lines.
---
 lisp/net/eww.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index da920c1..551517b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -402,6 +402,10 @@ Currently this means either text/html or 
application/xhtml+xml."
                (condition-case nil
                    (decode-coding-region (point) (point-max) encode)
                  (coding-system-error nil))
+                (save-excursion
+                  ;; Remove CRLF before parsing.
+                  (while (re-search-forward "\r$" nil t)
+                    (replace-match "" t t)))
                (libxml-parse-html-region (point) (point-max))))))
        (source (and (null document)
                     (buffer-substring (point) (point-max)))))



reply via email to

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