org-html-final-function: Suppress mode hooks when indenting

* lisp/ox-html.el (org-html-final-function): When setting indentation,
use defaults, suppressing major mode hook.  If we do not, all kinds of
user code may be executed.

This fix will only work starting from Emacs 30, after bug#70671 is
fixed:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70671

Reported-by: arozbiz@gmail.com
Link: https://orgmode.org/list/87tu21hsuk.fsf@localhost
This commit is contained in:
Ihor Radchenko 2024-05-11 13:02:10 +03:00
parent 4131926984
commit e36a4fe20e
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -3967,7 +3967,7 @@ contextual information."
CONTENTS is the exported HTML code. INFO is the info plist."
(with-temp-buffer
(insert contents)
(set-auto-mode t)
(delay-mode-hooks (set-auto-mode t))
(when (plist-get info :html-indent)
(indent-region (point-min) (point-max)))
(buffer-substring-no-properties (point-min) (point-max))))