From 8419328ab5ca0de89d4a620bb0ca69a21e07944a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 13 Feb 2021 22:24:16 +0100 Subject: [PATCH] prefer shell based unstring function --- list.sh | 4 ++-- view.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/list.sh b/list.sh index e7b856c..1ae43f1 100644 --- a/list.sh +++ b/list.sh @@ -35,8 +35,8 @@ list_item() { "$link" "$link" "${name##/}" \ "$((length / 60))" "$((length % 60))" \ "$width" "$height" \ - "$(printf '%s\n' "${tags#tags=}" \ - | sed -r "$UNSTRING"' s;^;,;; s;,+;,;g; s;,$;;; + "$(UNSTRING "${tags#tags=}" \ + | sed -r 's;^;,;; s;,+;,;g; s;,$;;; :X s;,-?([^,]+)(,|$); [span .tag\n \1]\2;; tX;' )" "$name" "$link" "$link" else diff --git a/view.sh b/view.sh index 90075f7..3aa4d97 100644 --- a/view.sh +++ b/view.sh @@ -37,7 +37,7 @@ printf 'Content-Type: text/html;charset=utf-8\r\n\r\n' [span .time %i:%02imin] [span .dim %ix%i] %s ' "$(HTML "${ITEM##*/}" |sed -r "$w_ascii"' s;[^0-9a-zA-Z&#];&[wbr];g')" \ "$((length / 60))" "$((length % 60))" "$width" "$height" \ - "$(printf '%s\n' "${tags#tags=}" |sed -r "$UNSTRING"' + "$(UNSTRING "${tags#tags=}" |sed -r ' s;^;,;; s;,+;,;g; s;,$;;; :X s;,-?([^,]+)(,|$); [span .tag\n \1]\2;; tX;' )" printf ' -- 2.39.2