From bc64e33d311a63c0812b7f7e41aa85b7c48c5155 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 15 May 2021 12:19:07 +0200 Subject: [PATCH] prevent double escaping in translatable teltype --- cards/widgets.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cards/widgets.sh b/cards/widgets.sh index ab317fb..8b5b986 100755 --- a/cards/widgets.sh +++ b/cards/widgets.sh @@ -111,9 +111,10 @@ card_item(){ [ $cnt -gt 0 ] && printf '[h3 %s]' "$(l10n TEL)" seq 1 $cnt |while read c; do teltype="$(pdi_attrib "$card" TEL $c TYPE)" + ttl10="$(l10n "TYPE=$teltype")" # See below: HTML-Escape teltype if there is no translation (translations are always pre escaped) [ "$teltype" ] \ && printf '[span .item .TEL [span .type . %s:] %s]' \ - "$(l10n "TYPE=$teltype" |HTML)" \ + "$([ "$ttl10" = "TYPE=$teltype" ] && { printf %s "$ttl10" |HTML; } || printf %s "$ttl10")" \ "$(pdi_value "$card" TEL $c |pdi_unescape |HTML)" \ || printf '[span .item .TEL . %s]' \ "$(pdi_value "$card" TEL $c |pdi_unescape |HTML)" -- 2.39.2