From: Mike Frysinger Date: Tue, 31 Jul 2012 21:02:03 +0000 (-0400) Subject: convert more html entities X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e0db24bd4f7fb01dd00461b60ce8ca35ac5a5cf9;p=home.git convert more html entities --- diff --git a/.profile.d/aliases.sh b/.profile.d/aliases.sh index 3130b2e..26a0c76 100644 --- a/.profile.d/aliases.sh +++ b/.profile.d/aliases.sh @@ -1,5 +1,3 @@ -[[ $- != *i* ]] && return - alias axine='xine -A null' alias b='bzr' alias bc='bc -q' @@ -57,9 +55,13 @@ scrub_patch() { } scrub_html() { - sed -i \ - -e 's:<:<:g' -e 's:>:>:g' \ - -e 's: ::g' -e 's:&:\&:g' \ - -e 's:":":g' \ - "$@" + local a=( + 'lt' '<' + 'gt' '>' + 'nbsp' ' ' + 'amp' '&' + 'quot' '"' + ) + [[ $# -gt 0 ]] && set -- "$@" -i + eval sed \"\$@\" $(printf -- ' -e "s|\&%s;|%q|g"' "${a[@]}") }