]> git.plutz.net Git - webpoll/commitdiff
Merge commit '43aa4473be55cfbf22cc7e7a2e331b0291af81e4'
authorPaul Hänsch <paul@plutz.net>
Mon, 26 Jul 2021 13:10:28 +0000 (15:10 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 26 Jul 2021 13:10:28 +0000 (15:10 +0200)
1  2 
cgilite/file.sh
cgilite/markdown.awk

diff --combined cgilite/file.sh
index 04a8ef617c9f755a4dcb7c3cf3adeeca69683f27,6f956dfeb5989a6b2542534d78134bc4633217de..6f956dfeb5989a6b2542534d78134bc4633217de
@@@ -58,8 -58,7 +58,7 @@@ FILE()
  
    file_size="$(stat -Lc %s "$file")"
    file_date="$(stat -Lc %Y "$file")"
-   http_date="$(date -uRd @$file_date)"
-   http_date="${http_date%+0000}GMT"
+   http_date="$(date -ud "@$file_date" +"%a, %d %b %Y %T GMT")"
    cachedate="$(
      # Parse the allowable date formats from Section 3.3.1 of
      # https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
diff --combined cgilite/markdown.awk
index 512be5d5723da1f9a049bb1ba31241d813dba5ac,361e6005c3fc42fa5e1f81859d69ec59d0c0a138..361e6005c3fc42fa5e1f81859d69ec59d0c0a138
@@@ -274,11 -274,6 +274,6 @@@ function _block( block, LOCAL, st, len
    } else if ( AllowHTML && match( block, /^ ? ? ?(<\/[A-Za-z][A-Za-z0-9-]*[[:space:]]*>|<[A-Za-z][A-Za-z0-9-]*([[:space:]]+[A-Za-z_:][A-Za-z0-9_\.:-]*([[:space:]]*=[[:space:]]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))?)*[[:space:]]*\/?>)([[:space:]]*\n)([^\n]|\n[ \t]*[^\n])*(\n[[:space:]]*\n|$)/) ) {
      len = RLENGTH; st = RSTART;
      return substr(block, st, len) _block(substr(block, st + len));
-   # Horizontal rule
-   } else if ( match( block, /(^|\n) ? ? ?((\* *){3,}|(- *){3,}|(_ *){3,})($|\n)/) ) {
-     len = RLENGTH; st = RSTART;
-     return _block(substr(block, 1, st - 1)) "<hr />\n" _block(substr(block, st + len));
   
    # Blockquote (leading >)
    } else if ( match( block, /^> /) ) {
      return "<h" hlvl " id=\"" hid " - " HTML(htxt) "\">" inline( htxt ) "</h" hlvl ">\n\n" \
             _block( substr( block, len + 1) );
  
+   # Horizontal rule
+   } else if ( match( block, /(^|\n) ? ? ?((\* *){3,}|(- *){3,}|(_ *){3,})($|\n)/) ) {
+     len = RLENGTH; st = RSTART;
+     return _block(substr(block, 1, st - 1)) "<hr />\n" _block(substr(block, st + len));
    # Plain paragraph
    } else {
      match( block, /(^|\n)[[:space:]]*(\n|$)/ ) || match( block, /$/ );