From a2c919ca2ea631dbfdd7ae701ff00ac061f7dc18 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sun, 17 Jul 2022 19:18:22 -0700 Subject: [PATCH] Remove one extra indent level We don't need to indent children of or since the element type will give away the parent. --- scripts/xhtmlize-single-file.sh | 4 ++-- scripts/xhtmlize.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/xhtmlize-single-file.sh b/scripts/xhtmlize-single-file.sh index 187e2d4..6a9f155 100644 --- a/scripts/xhtmlize-single-file.sh +++ b/scripts/xhtmlize-single-file.sh @@ -25,8 +25,8 @@ cleanup() { trap cleanup EXIT # delete the stylesheet from the html file; we'll re-insert it later. -# Also remove one indentation level -sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t' '' >"$tmp_file" +# Also remove two indentation levels +sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t(?:\t)?' '' >"$tmp_file" { head -n7 "$tmp_file" | sd -s '/>' ' />' cat tmp.css diff --git a/scripts/xhtmlize.sh b/scripts/xhtmlize.sh index c2a4f87..b5bfd90 100644 --- a/scripts/xhtmlize.sh +++ b/scripts/xhtmlize.sh @@ -8,7 +8,7 @@ set -e -u output_dir="$1" script_dir="$(dirname "$0")" -printf '\t\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css +printf '\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css cleanup() { rm -f "tmp.css" }