From 3ca1a0f4f5088d8db2794910652cd4610a2e2230 Mon Sep 17 00:00:00 2001 From: the lemons Date: Sat, 5 Feb 2022 16:01:27 -0600 Subject: case-insensitive backlinks --- zzcxz.cgi | 7 ++++--- 1 file 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 -- cgit v1.2.3