pub / zeitung

News-Aggregator in newspaper style as HTML/PDF/EPUB
git clone src.jayvii.de/pub/zeitung.git
Home | Log | Files | Exports | Refs | README | RSS

commit cf1db6ea5ee6801c3281a53d9f27eca02cd453fa
parent 62856fb699368d6cebc5abf1329a881e48c62341
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Sun, 26 Apr 2026 10:40:32 +0200

fix: ensure source file is UTF8; improve stylization detection

Diffstat:
Mgenerate.sh | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/generate.sh b/generate.sh @@ -53,8 +53,10 @@ sed -E \ -e 's/\—/\-/g' \ -e 's/\–/\-/g' \ -i ./output/zeitung.md -iconv -t ascii -c ./output/zeitung.md | tee ./output/tmp.md > /dev/null -mv ./output/tmp.md ./output/zeitung.md +tmp=$(mktemp --dry-run) +iconv -t ascii -c ./output/zeitung.md | tee "${tmp}" > /dev/null +iconv -t utf-8 "${tmp}" | tee ./output/zeitung.md > /dev/null +rm "${tmp}" sed -E \ -e 's/\[`a\]/á/g' \ -e 's/\[`e\]/é/g' \ @@ -103,13 +105,13 @@ sed -E \ -i ./output/zeitung.md ## replace strong, bold, italic, emphasis tags with markdown syntax -perl -pe 'BEGIN{undef $/;} s/<strong[^>]*?>(.*?)<\/strong>/ __$1__ /smg' \ +perl -pe 'BEGIN{undef $/;} s/<strong[^>]*?>\s*(.*?)\s*<\/strong>/ __$1__ /smg' \ -i ./output/zeitung.md -perl -pe 'BEGIN{undef $/;} s/<b[^>]*?>(.*?)<\/b>/ __$1__ /smg' \ +perl -pe 'BEGIN{undef $/;} s/<b[^>]*?>\s*(.*?)\s*<\/b>/ __$1__ /smg' \ -i ./output/zeitung.md -perl -pe 'BEGIN{undef $/;} s/<i[^>]*?>(.*?)<\/i>/ _$1_ /smg' \ +perl -pe 'BEGIN{undef $/;} s/<i[^>]*?>\s*(.*?)\s*<\/i>/ _$1_ /smg' \ -i ./output/zeitung.md -perl -pe 'BEGIN{undef $/;} s/<em[^>]*?>(.*?)<\/em>/ _$1_ /smg' \ +perl -pe 'BEGIN{undef $/;} s/<em[^>]*?>\s*(.*?)\s*<\/em>/ _$1_ /smg' \ -i ./output/zeitung.md ## remove any content that is within specific html tags