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.
This commit is contained in:
Lars Ingebrigtsen 2016-02-16 17:38:58 +11:00
parent 57d0e3d5ae
commit b1a3ebedba

View file

@ -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)))))