Hash :
a4538bc6
Author :
Thomas de Grivel
Date :
2023-02-14T18:45:42
#!/bin/sh
set -e
ansi2html_sed () {
sed -e 's|&|&|g' \
-e 's|<|<|g' \
-e 's|>|>|g' \
-e "s|$(printf '\33\\[0;34m')|<span style=\"color: blue;\">|g" \
-e "s|$(printf '\33\\[0;35m')|<span style=\"color: purple;\">|g" \
-e "s|$(printf '\33\\[0m')|</span>|g"
# -e 's|$|<br/>|'
}
if [ $# -gt 0 ]; then
for F; do
ansi2html_sed < "$F" > "$F.html.tmp"
mv "$F.html.tmp" "$F.html"
done
else
ansi2html_sed
fi