From 25684aa384ec952f91de095d8054affa1e29d47b Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 29 Aug 2023 20:37:47 -0700 Subject: [PATCH] post-processing: minor fixes --- scripts/xhtmlize-single-file.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/xhtmlize-single-file.sh b/scripts/xhtmlize-single-file.sh index 6b9865f..4f5f398 100644 --- a/scripts/xhtmlize-single-file.sh +++ b/scripts/xhtmlize-single-file.sh @@ -32,11 +32,12 @@ sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | tail -n +2 | s cat "$OUTPUT_DIR/tmp.css" # shellcheck disable=SC2016 # these are regex statements, not shell expressions tail -n +8 "$tmp_file" \ - | sd '\n\t*<(code|samp)( |>)' '
<$1$2' \
+		| sd '\n(?:\t|\s)*<(code|samp)( |>)' '
<$1$2' \
 		| sd '(?:\n)?\n(?:[\t\s]*)?
' '
' \ - | sd '.span itemprop="familyName"' ' (?: )?.span itemprop="familyName"' '  <' \ | sd '([a-z])<(data|time)' '$1 <$2' \ | sd '(]*rel="(?:nofollow ugc|ugc nofollow)"(?:[^>]*)?>liked)' ' $1' \ - | sd -s '/>' ' />' + | sd '([^ ])/>' '$1 />' } >"$html_file"