]> git.plutz.net Git - serve0/blobdiff - widgets.sh
Merge commit '00aa1675c49f23eb075d1fc7ceb69bac5e1ba83c'
[serve0] / widgets.sh
index 5cd371b7e8ae47040db55a617c04fdefc3ca2f9a..6af562e84cb4f4e7fa6e3d703472e8df144737db 100644 (file)
@@ -14,19 +14,19 @@ c_tags="$_DATA/.index/tags.cache"; c_tagcategories="$_DATA/.index/tagcategories.
 if [ ! -s "$c_tags" -o ! -s "$c_tagcategories" ] \
    || [ "$(find "$_DATA/" -path '*/.index/meta' -newer "$c_tags")" ]
   then
-  w_tags="$( local cn=1
+  w_tags="$( cn=1
     find "$_DATA/" -path '*/.index/meta' -print0 \
-    | xargs -r0 sed -r '
+    | xargs -0 -r sed -E '
       s;^.*\t.*\t.*\ttags=(.*)\tcomment=.*\t.*\r$;\1;;
-      s;,;\n;g;'"$UNSTRING" \
+      s;,;\n;g;' \
     | { sort; printf '\n'; } \
     | while read -r tag; do
-      [ "$tag" = "$otag" ] \
-      && cn=$((cn + 1)) \
-      || {
-        printf "%i     %s\n" "$cn" "$otag"
+      if [ "$tag" = "$otag" ]; then
+        cn=$((cn + 1))
+      else
+        printf "%i     %s\n" "$cn" "$(UNSTRING "$otag")"
         cn=1
-      }
+      fi
       otag="$tag"
     done \
     |sort -rn |cut -f2- |HTML \
@@ -218,7 +218,7 @@ w_advsearch(){
        printf '[label [checkbox "tag_%s" "%s" %s] %s]' "$n" "$tag" "$t" "$d"
       done
       d="${f##*\$:}" d="${d%%\|*}"
-      [ "$category" = \$ ] && printf '[input name="tag_%i" value="%s"]' "$n" "$d"
+      [ "$category" = \$ ] && printf '[input name="tag_%i" value="%s"]' "$n" "$(HTML "$d")"
       printf '\n]'
     done
     printf ']'