Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 923faef

Browse files
committedJan 19, 2021
Update to fix stdin better
1 parent 15dc4bb commit 923faef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎renderer.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ TempDir=$(mktemp -d)
1212
ArticleFile="$TempDir/Article.html"
1313
OutFile="$TempDir/OutFile.html"
1414

15-
while IFS= read -r line; do
16-
printf '%s\n' "$line" >> $ArticleFile
17-
done
15+
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"
16+
cat $input > "$ArticleFile"
1817

1918
cat $ArticleFile | sed -e 's/<img[^>]*>//g' | sed -e 's/<div[^>]*>//g' | hxclean | hxnormalize -e -L -s 2>/dev/null | tidy -quiet -omit -clean 2>/dev/null | hxunent | iconv -t utf-8//TRANSLIT - | sed -e 's/\(<em>\|<i>\|<\/em>\|<\/i>\)/&🞵/g' | sed -e 's/\(<strong>\|<b>\|<\/strong>\|<\/b>\)/&🞶/g' |lynx -dump -stdin -display_charset UTF-8 -width 140 | sed -e 's/\*/•/g' | sed -e 's/Θ/🞵/g' | sed -e 's/Φ/🞯/g' | sed 's/^/
2019
\t/'

0 commit comments

Comments
 (0)
Please sign in to comment.