From 64b39909f4a3f4d67269718c8f5e8e4b7ea092b3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 9 Oct 2023 01:54:31 +0200 Subject: [PATCH] Syntax help fro white space file names --- themes/default.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/themes/default.sh b/themes/default.sh index eb3d537..23b03f2 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -108,17 +108,21 @@ theme_editor(){ $(for file in "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments"/* "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments"/*; do [ "$file" = "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" \ -a -f "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" ] && continue + att="$(HTML "${file##*/}")" + url="$(printf %s\\n "${file##*/}" |sed 's;[\\<>];\\&;g' |HTML)" + name="$(printf %s\\n "${file##*/}" |sed 's;[]\\[];\\&;g' |HTML)" case ${file##*/} in \*) continue;; *.[pP][nN][gG]|*.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[gG][iI][fF]) [ "$page" != "${page%/:$LANGUAGE/}" ] && p=../ || p='' - att="$(HTML "${file##*/}")" - printf '

![](%s)

' \ - "$p" "$att" "$att" "$att" "$att" "$att" "$att" "$att" + printf '

![](<%s>)

' \ + "$p" "$att" "$url" "$name" "$url" "$name" "$url" "$url" ;; *) - att="$(HTML "${file##*/}")" - printf '

[%s](%s)

' "$att" "$att" + printf '

[%s](<%s>)

' "$name" "$url" ;; esac done) -- 2.39.2