diff options
| author | Paul Eggert | 2019-02-27 14:35:51 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-02-27 14:37:38 -0800 |
| commit | 4927f94792ffaab985e0aa3c977eb19308f067cf (patch) | |
| tree | 9bd14488427983e69c76bd2076188a271323e341 | |
| parent | 4a16e6302d8971a2414543c9c04405df99271dfa (diff) | |
| download | emacs-4927f94792ffaab985e0aa3c977eb19308f067cf.tar.gz emacs-4927f94792ffaab985e0aa3c977eb19308f067cf.zip | |
Escape HTML NUL as � in eww
* lisp/net/eww.el (eww-display-html): Escape NUL as � as this
is more appropriate for HTML.
| -rw-r--r-- | lisp/net/eww.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 3ec6c1cfd3b..3e9334532c6 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -471,11 +471,9 @@ Currently this means either text/html or application/xhtml+xml." | |||
| 471 | (decode-coding-region (point) (point-max) encode) | 471 | (decode-coding-region (point) (point-max) encode) |
| 472 | (coding-system-error nil)) | 472 | (coding-system-error nil)) |
| 473 | (save-excursion | 473 | (save-excursion |
| 474 | ;; Remove CRLF and NULL before parsing. | 474 | ;; Remove CRLF and replace NUL with � before parsing. |
| 475 | (while (re-search-forward "\\(\r$\\)\\|\\(\000\\)" nil t) | 475 | (while (re-search-forward "\\(\r$\\)\\|\0" nil t) |
| 476 | (replace-match (if (match-beginning 1) | 476 | (replace-match (if (match-beginning 1) "" "�") t t))) |
| 477 | "" | ||
| 478 | "\\0") t t))) | ||
| 479 | (libxml-parse-html-region (point) (point-max)))))) | 477 | (libxml-parse-html-region (point) (point-max)))))) |
| 480 | (source (and (null document) | 478 | (source (and (null document) |
| 481 | (buffer-substring (point) (point-max))))) | 479 | (buffer-substring (point) (point-max))))) |