}
w_tagging(){
- local tctag oldcat category tag
+ local tctag oldcat="" category tag
cat <<-EOF
[a href="#multitag" Add Tags / Remove Tags]
[a href="#" X]
EOF
- oldcat="Tags"
- printf '[fieldset [legend %s:][div .tagselect\n' "Tags"
printf '%s\n' "$w_tags" \
| while read tctag; do
[ "$tctag" ] || continue
&& category="Tags"
if [ "$category" != "$oldcat" ]; then
- printf ']]'
+ [ "$oldcat" ] && printf ']]'
printf '[fieldset [legend %s:][div .tagselect\n' "$category"
fi
printf '[label [checkbox "tag" "%s"] %s]\n' "$tctag" "$tag"
oldcat="$category"
done
- printf ']]'
+ [ "$w_tags" ] && printf ']]'
cat <<-EOF
[fieldset [legend New:][textarea name=newtag\n]