Skip to content

Commit e5e364f

Browse files
committed
fix: formatter for html
Fixes error caused by html formatter running even when tidy is not available on the system. Also fixes docs related to disabling formatters.
1 parent e1482ea commit e5e364f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ use {
8080
show_http_info = true,
8181
show_headers = true,
8282
-- executables or functions for formatting response body [optional]
83-
-- set them to nil if you want to disable them
83+
-- set them to false if you want to disable them
8484
formatters = {
8585
json = "jq",
8686
html = function(body)

lua/rest-nvim/config/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ local config = {
1616
formatters = {
1717
json = "jq",
1818
html = function(body)
19+
if vim.fn.executable("tidy") == 0 then
20+
return body
21+
end
1922
-- stylua: ignore
2023
return vim.fn.system({
2124
"tidy", "-i", "-q",

0 commit comments

Comments
 (0)