From a873721b0ca32b40f29ae8e3333c0eb558664386 Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Fri, 6 Aug 2021 21:42:10 -0400 Subject: [PATCH] ampersand sequencer --- homepage/htmlfriend.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 homepage/htmlfriend.sh diff --git a/homepage/htmlfriend.sh b/homepage/htmlfriend.sh new file mode 100644 index 0000000..cbe5ce4 --- /dev/null +++ b/homepage/htmlfriend.sh @@ -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//\>/g' \ + -e 's/Þ/Þ/g' \ + -e 's/þ/þ/g' +# add more as necessary