aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2022-02-05 16:01:27 -0600
committerthe lemons <citrons@mondecitronne.com>2022-02-05 16:01:27 -0600
commit3ca1a0f4f5088d8db2794910652cd4610a2e2230 (patch)
tree829995f428d94571ffd56fbd37547f9fceaeb15b
parenteb2175a2cdb9464a6052407f453ac0628bf60957 (diff)
case-insensitive backlinks
-rwxr-xr-xzzcxz.cgi7
1 files changed, 4 insertions, 3 deletions
diff --git a/zzcxz.cgi b/zzcxz.cgi
index 4fede97..704be9d 100755
--- a/zzcxz.cgi
+++ b/zzcxz.cgi
@@ -140,15 +140,16 @@ local not_found = function()
end
local function parse_directive(line, directives)
- local directive, args = line:match "^#([A-Z]+)%s*(.-)\n?$"
+ local directive, args = line:match "^#([A-Za-z]+)%s*(.-)\n?$"
+ directive = directive and directive:lower()
if not directive then
return
- elseif directive == "BACKLINK" then
+ elseif directive == "backlink" then
local page, action = args:match "^(%w%w%w%w%w)%s+(.+)$"
if not page then return end
directives.backlinks = directives.backlinks or {}
table.insert(directives.backlinks, {page = page, action = action})
- elseif directive == "DEADEND" then
+ elseif directive == "deadend" then
directives.deadend = true
else
return