From: Paul Hänsch Date: Sat, 15 May 2021 10:19:07 +0000 (+0200) Subject: prevent double escaping in translatable teltype X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=bc64e33d311a63c0812b7f7e41aa85b7c48c5155;p=lobster prevent double escaping in translatable teltype --- 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)"