From 952930c78dcfe7e4bb3a32504805239ae32073e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Mon=C3=ADa?= Date: Thu, 24 Oct 2024 13:09:11 -0400 Subject: [PATCH] More lax doctype check in EWW (bug#73133) The regexp to match doctype tags was simplified and will match more legacy entries; also correct binding of case-fold-search. * lisp/net/eww.el (eww--html buffer-list): Update function. --- lisp/net/eww.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 7bbbeadaedd..71e4d720b74 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -660,15 +660,14 @@ eww--html-if-doctype "Return \"text/html\" if RESPONSE-BUFFER has an HTML doctype declaration. HEADERS is unused." ;; https://html.spec.whatwg.org/multipage/syntax.html#the-doctype - (let ((case-fold-search t) - (target - "\\|system +\\(\\\"\\|'\\)+about:legacy-compat\\)")) - (with-current-buffer response-buffer - (goto-char (point-min)) - ;; match basic and also legacy variants as - ;; specified in link above - (when (re-search-forward target nil t) - "text/html")))) + (with-current-buffer response-buffer + (let ((case-fold-search t)) + (save-excursion + (goto-char (point-min)) + ;; match basic and also legacy variants as + ;; specified in link above - being purposely lax about it + (when (re-search-forward "