1
0
src/homepage/htmlfriend.sh
2021-08-06 21:42:10 -04:00

17 lines
529 B
Bash

#!/bin/sh
# This is a script that turns "stuff" (any text) into text that can be in HTML
# documents without weirdness. So, turn '>' into ">", etc.
# Right now it just turns certain chars into their ampersand sequences but more
# features will be added if necessary.
# http://rabbit.eng.miami.edu/info/htmlchars.html
# order matters; ampersand must be first
sed \
-e 's/&/\&/g' \
-e 's/\"/\"/g' \
-e 's/</\&lt;/g' \
-e 's/>/\&gt;/g' \
-e 's/Þ/&THORN;/g' \
-e 's/þ/&thorn;/g'
# add more as necessary