From: Paul Hänsch Date: Wed, 27 Jan 2021 12:16:03 +0000 (+0100) Subject: avoid space character in empty first name/middle name field; try to parse FN if N... X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=6217c300314dd5791995c9bb7e148c3752d2d3d1;p=confetti avoid space character in empty first name/middle name field; try to parse FN if N is not present --- diff --git a/cards/widgets.sh b/cards/widgets.sh index 52fca4e..5395a82 100755 --- a/cards/widgets.sh +++ b/cards/widgets.sh @@ -172,8 +172,7 @@ edit_item(){ EOF else N="$(pdi_value "$card" FN |unescape)" - n1="${N%%[a-z]*}" n1="${N#$n1}" - [ "$n1" ] || n1="${N##* }" + n1="${N##* }" n2="${N%$n1}" fi printf ' @@ -184,7 +183,7 @@ edit_item(){ [input .item .N name="5N" placeholder="%s" value="%s"] ' "$(l10n "$item")" \ "$(l10n n_pre)" "$(HTML "$n4")" \ - "$(l10n n_first)" "$(HTML "$n2" "$n3")" \ + "$(l10n n_first)" "$(HTML "${n2}$([ "$n2" -a "$n3" ] && printf ' ')${n3}")" \ "$(l10n n_last)" "$(HTML "$n1")" \ "$(l10n n_post)" "$(HTML "$n5")" ;;