From: Sebastián Monía Date: Thu, 24 Oct 2024 17:09:11 +0000 (-0400) Subject: More lax doctype check in EWW (bug#73133) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d12f0915666242425dc3226e832b1a94b4635a70;p=emacs.git 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. (cherry picked from commit 6a0c2b8729c436ef4dfecf07737c86936cb94bd5) --- diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 869fe869fff..c7d838c88d1 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -650,15 +650,14 @@ valid Content-Type header. If none of the functions can guess, return "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 (search-forward "