From e0db24bd4f7fb01dd00461b60ce8ca35ac5a5cf9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 31 Jul 2012 17:02:03 -0400 Subject: [PATCH] convert more html entities --- .profile.d/aliases.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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[@]}") } -- 2.39.5