aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_extensions/ruc-play/semantic-markdown/semantic-markdown.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
index 0ce1dcd..ef02b83 100644
--- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
+++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
@@ -133,13 +133,14 @@ local function Namespaces(blocks)
and blocks.content[2].t == "Space"
and blocks.content[1].text:match(curie_pattern)
then
+ local el = blocks.content[3]
-- default namespace, misparsed as a citation
- if blocks.content[3].t == "Cite"
- and #blocks.content[3].content == 1
+ if el.t == "Cite"
+ and #el.content == 1
-- TODO: maybe check case-insensitively
- and blocks.content[3].content[1].text == "@default"
+ and el.content[1].text == "@default"
then
-- FIXME: add CURIE to metadata
return {}
@@ -147,11 +148,11 @@ local function Namespaces(blocks)
-- namespace
local proto_pattern = "^https?:"
- if blocks.content[3].t == "Str"
+ if el.t == "Str"
-- TODO: maybe check case-insensitively
-- TODO: relax to match URI syntax without hardcoded protocols
- and blocks.content[3].text:match(proto_pattern)
+ and el.text:match(proto_pattern)
then
-- FIXME: add CURIE and URI to metadata
return {}