From 899d69358c9ffcbb699be32ff69cc95eebc17327 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Mon, 11 Aug 2025 19:12:02 -0300 Subject: [PATCH] feat(formatting): format xhtml with html-tidy --- lua/dot013/plugins/formatting.lua | 10 ++++++++-- package.nix | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/dot013/plugins/formatting.lua b/lua/dot013/plugins/formatting.lua index 1182cb6..1993ad8 100644 --- a/lua/dot013/plugins/formatting.lua +++ b/lua/dot013/plugins/formatting.lua @@ -34,8 +34,8 @@ return { nix = { "alejandra" }, rust = { "rustfmt", lsp_format = "fallback" }, sh = { "shellharden", "shfmt" }, - xml = { "xmllint" }, - xhtml = { "xmllint" }, + xml = { "xmllint", "xmltidy" }, + xhtml = { "xmllint", "xmltidy" }, markdown = { "mdfmt" }, html = { "prettierd", "prettier", stop_after_first = true }, @@ -87,6 +87,12 @@ return { mdfmt = { command = "mdfmt", }, + -- Uses HTML Tidy + xmltidy = { + inherit = false, + command = "tidy", + args = { "-xml", "-indent", "yes", "2", "-wrap", "100", "-" }, + }, }, }) end, diff --git a/package.nix b/package.nix index 92ed12b..26ae485 100644 --- a/package.nix +++ b/package.nix @@ -104,6 +104,7 @@ formatters = with pkgs; [ alejandra jq + html-tidy libxml2 mdfmt prettierd