1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Remove one extra indent level

We don't need to indent children of <body> or <head> since the element
type will give away the parent.
This commit is contained in:
Rohan Kumar 2022-07-17 19:18:22 -07:00
parent f99c153f72
commit a2c919ca2e
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -8,7 +8,7 @@ set -e -u
output_dir="$1"
script_dir="$(dirname "$0")"
printf '\t<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
printf '<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
cleanup() {
rm -f "tmp.css"
}