Merge pull request #563 from AlGreed/2.9dev

Avoidance of escape characters in JSON and CSV reports
This commit is contained in:
Dirk Wetter 2016-12-14 21:45:44 +01:00 committed by GitHub
commit 576d0f7412
1 changed files with 1 additions and 1 deletions

View File

@ -695,7 +695,7 @@ set_color_functions() {
strip_quote() { strip_quote() {
# remove color codes (see http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed) # remove color codes (see http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed)
# \', leading and all trailing spaces # \', leading and all trailing spaces
sed -e "s,\x1B\[[0-9;]*[a-zA-Z],,g" \ sed -e "s,$(echo -e "\033")\[[0-9;]*[a-zA-Z],,g" \
-e "s/\"/\\'/g" \ -e "s/\"/\\'/g" \
-e 's/^ *//g' \ -e 's/^ *//g' \
-e 's/ *$//g' <<< "$1" -e 's/ *$//g' <<< "$1"