fixed newlines screwing with the viewer

This commit is contained in:
celso 2023-03-23 00:21:23 -03:00
parent 68d9fbae8a
commit 24c05e35dc
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@ view_content(){
local -n _REF="${1}"
print_dashes; printf "\n"
for i in "${!_REF[@]}"; do
[ "${i}" == "text" ] && {
printf "[%s] \t=\t" "${i}"
sed ':a;N;$!ba;s/\n/\\n/g' <<< "${_REF[${i}]}"
continue
}
[ ! -z "${_REF[${i}]}" ] && printf "[%s] \t=\t%s\n" "${i}" "${_REF[${i}]}"
done
}