aboutsummaryrefslogtreecommitdiff
path: root/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
diff options
context:
space:
mode:
Diffstat (limited to '_extensions/ruc-play/semantic-markdown/semantic-markdown.lua')
-rw-r--r--_extensions/ruc-play/semantic-markdown/semantic-markdown.lua16
1 files changed, 4 insertions, 12 deletions
diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
index 4e7c3e5..b54cf5b 100644
--- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
+++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
@@ -161,15 +161,9 @@ function Statements (blocks)
for i, el in ipairs(blocks.content) do
- -- only string inlines can alter state
- if el.t ~= 'Str' then
- table.insert(new_inlines, el)
- goto continue
- end
-
-- unenclosed, entering bracketed enclosure
-- TODO: support nested bracket enclosure
- if not (pos_bracketed or pos_braced) then
+ if el.t == 'Str' and not (pos_bracketed or pos_braced) then
_, pos_bracket_begin = string.find(el.text, "%[")
if pos_bracket_begin then
pos_bracketed = pos_bracket_begin + 1
@@ -178,7 +172,7 @@ function Statements (blocks)
-- in bracketed enclosure, entering braced enclosure
-- TODO: support nested bracket enclosure
- if pos_bracketed and not pos_braced then
+ if el.t == 'Str' and pos_bracketed and not pos_braced then
_, pos_brace_begin, s = string.find(el.text, "^([^%[%]}]*)%]{",
pos_bracketed)
if pos_brace_begin then
@@ -187,12 +181,10 @@ function Statements (blocks)
end
end
- -- (ignore space-delimited enclosures: not in spec for inlines)
-
-- in braced enclosure, leaving it
-- TODO: support mixed-use enclosure
-- TODO: cover curie_prefix and curie_local and curie_default
- if pos_braced then
+ if el.t == 'Str' and pos_braced then
_, pos_brace_end = string.find(el.text, "^"..curie_long.."}",
pos_braced)
if pos_brace_end then
@@ -200,7 +192,7 @@ function Statements (blocks)
-- TODO: call same function with remains of Str
end
end
- ::continue::
+ table.insert(new_inlines, el)
end
-- FIXME
-- if statement_count then