summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2020-09-19 19:15:48 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-19 19:15:48 +0200
commitc9f845a53c946f28820a476de7089f486ccaf6b9 (patch)
tree89b368ce0a13026807c7dc303c469633ad17f087 /lisp/files.el
parent7222e975be8d3d128086ed49506aa5bd8fccfae5 (diff)
downloademacs-c9f845a53c946f28820a476de7089f486ccaf6b9.tar.gz
Put files in mhtml-mode when they have <!DOCTYPE, case-insensitive
* lisp/files.el (magic-fallback-mode-alist): Match "DOCTYPE" in a case-insensitive way before putting files in mhtml-mode. See https://html.spec.whatwg.org/multipage/syntax.html#the-doctype for the standard reference. * test/lisp/files-tests.el (files-test-magic-mode-alist-doctype): Add a test (bug#43511).
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 07d66c9d384..98de93c8693 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3067,7 +3067,7 @@ If FUNCTION is nil, then it is not called. (That is a way of saying
"\\(?:!DOCTYPE[ \t\r\n]+[^>]*>[ \t\r\n]*<[ \t\r\n]*" comment-re "*\\)?"
"[Hh][Tt][Mm][Ll]"))
. mhtml-mode)
- ("<!DOCTYPE[ \t\r\n]+[Hh][Tt][Mm][Ll]" . mhtml-mode)
+ ("<![Dd][Oo][Cc][Tt][Yy][Pp][Ee][ \t\r\n]+[Hh][Tt][Mm][Ll]" . mhtml-mode)
;; These two must come after html, because they are more general:
("<\\?xml " . xml-mode)
(,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")