From a460f3d378f52e8a09441455be764eec595a3314 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 8 Nov 2021 06:04:11 +0100 Subject: [PATCH] Make html-mode--html-yank-handler more resilient * lisp/textmodes/sgml-mode.el (html-mode--html-yank-handler): The HTML may not be valid, so suppress errors. --- lisp/textmodes/sgml-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 3b0c5d8b65c..dedc3882199 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -2435,7 +2435,8 @@ To work around that, do: (defun html-mode--html-yank-handler (_type html) (save-restriction (insert html) - (sgml-pretty-print (point-min) (point-max)))) + (ignore-errors + (sgml-pretty-print (point-min) (point-max))))) (defun html-mode--image-yank-handler (type image) (let ((file (read-file-name (format "Save %s image to: " type)))) -- 2.39.2