Hash :
7148731b
Author :
Thomas de Grivel
Date :
2023-02-15T20:37:22
#!/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