summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua')
-rw-r--r--Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua b/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua
index 8318a8b8949..4bb0976b0d9 100644
--- a/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua
+++ b/Master/texmf-dist/scripts/make4ht/extensions/make4ht-ext-tidy.lua
@@ -44,9 +44,13 @@ function M.modify_build(make)
local command = "tidy ${options} ${filename}" % par
log:info("running tidy: ".. command)
-- os.execute(command)
- local run = io.popen(command, "r")
+ local run, msg = io.popen(command, "r")
local result = run:read("*all")
run:close()
+ if not result or result == "" then
+ log:warning("Cannot execute Tidy command")
+ return nil
+ end
result = close_tags(result)
local f = io.open(filename, "w")
f:write(result)