From 6217c300314dd5791995c9bb7e148c3752d2d3d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 27 Jan 2021 13:16:03 +0100 Subject: [PATCH 1/1] avoid space character in empty first name/middle name field; try to parse FN if N is not present --- cards/widgets.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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")" ;; -- 2.39.2