avoid space character in empty first name/middle name field; try to parse FN if N...
[confetti] / cards / widgets.sh
index 52fca4e..5395a82 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")"
         ;;