aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-05-10 13:34:34 +0200
committerJonas Smedegaard <dr@jones.dk>2025-05-10 13:34:34 +0200
commitdbd88f3cc8657ae0b31022656917a663c8b9563e (patch)
tree1caad29c60e144971a48822b4c7221c3d3c415e1
parent0d28a16b10cafe1fd0be27129e126de39e91d276 (diff)
disambiguate pattern variables
-rw-r--r--_extensions/ruc-play/semantic-markdown/semantic-markdown.lua8
1 files 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 {}