diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el index 13c8fb9b5..e5d70fa86 100644 --- a/modules/lang/web/+html.el +++ b/modules/lang/web/+html.el @@ -17,6 +17,18 @@ :config (set-docsets! 'web-mode "HTML" "Twig" "WordPress") + ;; tidy is already defined by the format-all package. We redefine it to add + ;; more sensible arguments to the tidy command. + (set-formatter! 'html-tidy + '("tidy" "-q" "-indent" + "--tidy-mark" "no" + "--drop-empty-elements" "no" + "--show-body-only" "auto" + ("--indent-spaces" "%d" tab-width) + ("--indent-with-tabs" "%s" (if indent-tabs-mode "yes" "no")) + ("-xml" (memq major-mode '(nxml-mode xml-mode)))) + :ok-statuses '(0 1)) + (setq web-mode-enable-html-entities-fontification t web-mode-auto-close-style 2)