From dbd88f3cc8657ae0b31022656917a663c8b9563e Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 10 May 2025 13:34:34 +0200 Subject: disambiguate pattern variables --- _extensions/ruc-play/semantic-markdown/semantic-markdown.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua index 12fa812..54b2732 100644 --- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua +++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua @@ -127,11 +127,11 @@ local curie_default = ":" local function Namespaces(blocks) -- paragraph with only a braced prefix-only CURIE, colon and one word - local pattern = "^{"..curie_prefix.."}:$" + local curie_pattern = "^{"..curie_prefix.."}:$" if #blocks.content == 3 and blocks.content[1].t == "Str" and blocks.content[2].t == "Space" - and blocks.content[1].text:match(pattern) + and blocks.content[1].text:match(curie_pattern) then -- default namespace, misparsed as a citation @@ -146,12 +146,12 @@ local function Namespaces(blocks) end -- namespace - local pattern = "^https?:" + local proto_pattern = "^https?:" if blocks.content[3].t == "Str" -- TODO: maybe check case-insensitively -- TODO: relax to match URI syntax without hardcoded protocols - and blocks.content[3].text:match(pattern) + and blocks.content[3].text:match(proto_pattern) then -- FIXME: add CURIE and URI to metadata return {} -- cgit v1.2.3