1
0
Fork 0
postfix/mantools/html2readme
Daniel Baumann 75cf244379
Adding upstream version 3.10.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 14:19:32 +02:00

31 lines
443 B
Bash
Executable file

#!/bin/sh
HTML2TEXT="html2text -ascii -style pretty -rcfile html2text.rc"
#case $# in
# 0) $HTML2TEXT;;
# *) for file
# do
# cat <<EOF | fmt
#[hyperlinked version: www.postfix.org/$file]
#EOF
# $HTML2TEXT $file
# done;;
#esac | sed '
$HTML2TEXT "$@" | sed '
:top
/ -$/ {
N
s/ -\n o/ -o/
b top
}
/^ \*$/ {
N
s/\*\n /* /
b top
}
' | awk '
/^$/ && prev_len == 0 { next }
{ print; prev_len = length }
'