]> git.plutz.net Git - confetti/commitdiff
avoid space character in empty first name/middle name field; try to parse FN if N...
authorPaul Hänsch <paul@plutz.net>
Wed, 27 Jan 2021 12:16:03 +0000 (13:16 +0100)
committerPaul Hänsch <paul@plutz.net>
Wed, 27 Jan 2021 12:16:03 +0000 (13:16 +0100)
cards/widgets.sh

index 52fca4e25e9b9e52e8fd9df0cb526fd1e5f896e6..5395a8299a326f424e4b2909700f36c9911d3011 100755 (executable)
@@ -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")"
         ;;