* fixes in unsafe rendering

merge-requests/2/head
Dominika Liberda 2021-02-28 13:45:29 +01:00
parent 9a1683a3d4
commit 68e1c1b06c
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ function render_unsafe() {
local template="$(cat "$2")"
local -n ref=$1
for key in ${!ref[@]}; do
local value="$(sed -E 's/\&/\\\&/g;s/\//\\\//g' <<< "${ref[$key]}")"
local value="$(xxd -ps <<< "${ref[$key]}" | tr -d '\n' | sed -E 's/.{2}/\\x&/g')"
template="$(sed -E 's/\{\{\.'"$key"'\}\}/'"$value"'/g' <<< "$template")"
done