From: Paul Hänsch Date: Wed, 28 Jul 2021 20:31:07 +0000 (+0200) Subject: move markdown wrapper to widgets X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=1b9f025da80bb30db913635a60e799a3e523f2e1;p=webpoll move markdown wrapper to widgets --- diff --git a/index.cgi b/index.cgi index 8bc1ad0..1bfc2b7 100755 --- a/index.cgi +++ b/index.cgi @@ -11,13 +11,6 @@ _BASE="${_BASE%/}" #. "$_EXEC"/session_lock.sh . "$_EXEC"/widgets.sh -export MD_HTML="false" -if [ "$(which awk)" ]; then - markdown() { awk -f "$_EXEC/cgilite/markdown.awk"; } -else - markdown() { busybox awk -f "$_EXEC/cgilite/markdown.awk"; } -fi - PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")" #git init "$_DATA" >/dev/null & diff --git a/widgets.sh b/widgets.sh index ab88b3e..3eb4850 100755 --- a/widgets.sh +++ b/widgets.sh @@ -1,5 +1,12 @@ #!/bin/sh +export MD_HTML="false" +if [ "$(which awk)" ]; then + markdown() { awk -f "$_EXEC/cgilite/markdown.awk"; } +else + markdown() { busybox awk -f "$_EXEC/cgilite/markdown.awk"; } +fi + checked(){ local check="$1"; shift 1; for comp in "$@"; do