Commit 4927f947 authored by Paul Eggert's avatar Paul Eggert

Escape HTML NUL as � in eww

* lisp/net/eww.el (eww-display-html): Escape NUL as � as this
is more appropriate for HTML.
parent 4a16e630
Pipeline #873 passed with stage
in 50 minutes and 30 seconds
......@@ -471,11 +471,9 @@ Currently this means either text/html or application/xhtml+xml."
(decode-coding-region (point) (point-max) encode)
(coding-system-error nil))
;; Remove CRLF and NULL before parsing.
(while (re-search-forward "\\(\r$\\)\\|\\(\000\\)" nil t)
(replace-match (if (match-beginning 1)
"\\0") t t)))
;; Remove CRLF and replace NUL with � before parsing.
(while (re-search-forward "\\(\r$\\)\\|\0" nil t)
(replace-match (if (match-beginning 1) "" "�") t t)))
(libxml-parse-html-region (point) (point-max))))))
(source (and (null document)
(buffer-substring (point) (point-max)))))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment