1
0

ampersand sequencer

This commit is contained in:
dtb 2021-08-06 21:42:10 -04:00
parent 85145ba1e2
commit a873721b0c

16
homepage/htmlfriend.sh Normal file
View File

@ -0,0 +1,16 @@
#!/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