From 8971d74dacbb9adbfcc1112acaab1e6882f0944e Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sun, 26 Nov 2023 14:37:07 -0800 Subject: [PATCH] try to get xmllint to print diagnostics --- scripts/xhtmlize-single-file.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/xhtmlize-single-file.sh b/scripts/xhtmlize-single-file.sh index b2d1289..1296b31 100644 --- a/scripts/xhtmlize-single-file.sh +++ b/scripts/xhtmlize-single-file.sh @@ -25,12 +25,19 @@ cleanup() { } trap cleanup EXIT -run_tidy() { - tidy -asxhtml -config linter-configs/tidy.conf 2>/dev/null || true +# run_tidy() { +# tidy -asxhtml -config linter-configs/tidy.conf 2>/dev/null || true +# } + +run_xmllint() { + xmllint --format --encode UTF-8 --noent - || { + echo "$html_file" + exit 1 + } } # delete the stylesheet from the html file; we'll re-insert it later. -sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | tail -n +2 >"$tmp_file" +sed 7d "$html_file" | run_xmllint | tail -n +2 >"$tmp_file" { head -n7 "$tmp_file" cat "${OUTPUT_DIR:?}/tmp.css"