X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=index.cgi;h=0694c6e4d9b5f8c9c9ea8fa3c744149d8a2ece86;hb=258959637ea2f9499c8807daf21d7e1057c4ad14;hp=9037c330099f6bc876743d39888543912bf3058c;hpb=0b60e2e81ffac0fcdd7760d3034f0e1d36f40c8f;p=webpoll diff --git a/index.cgi b/index.cgi index 9037c33..0694c6e 100755 --- a/index.cgi +++ b/index.cgi @@ -11,6 +11,13 @@ _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 & @@ -28,7 +35,7 @@ yield_page(){ [link rel="stylesheet" type="text/css" href="%s/webpoll.css"] [title %s] ] [body class="%s" - ' "$_BASE" "$_BASE" "$_BASE" "$title" "$page" + ' "$_BASE" "$_BASE" "$_BASE" "$(HTML "$title")" "$page" cat printf '] ]' } |"$_EXEC/cgilite/html-sh.sed" -u @@ -77,6 +84,7 @@ page_home() { fi } page_newdate() { . "$_EXEC"/newdate.sh; } +page_poll() { . "$_EXEC/poll.sh"; } case ${PATH_INFO} in /favicon.ico) printf '%s\r\n' 'Content-Length: 0' '';; @@ -85,7 +93,7 @@ case ${PATH_INFO} in /) page_home;; /*/newdate) page_newdate;; /*/newoptions);; - *);; + /[0-9a-zA-Z:=]???????????????) page_poll;; esac exit 0