aboutsummaryrefslogtreecommitdiff
path: root/_extensions
diff options
context:
space:
mode:
Diffstat (limited to '_extensions')
-rw-r--r--_extensions/ruc-play/semantic-markdown/semantic-markdown.lua23
1 files changed, 12 insertions, 11 deletions
diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
index 407912d..3dd08d8 100644
--- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
+++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
@@ -234,24 +234,25 @@ local function Statements (block)
local pos = 1
local chars = ""
- -- non-string element
+ -- non-string element, highest state first to support fall-through
if el.t ~= 'Str' then
- -- specific elements represent content enclosure
- if encl == Enclosure.NONE then
- if ElementTypeIsEnclosure[el.t] then
- encl = Enclosure.BRACKETED_DONE
- end
+ -- collect element, except in braced enclosure
+ -- TODO: support mixed-use braced enclosure
+ if encl ~= Enclosure.BRACED then
+ elems:insert(el)
+ end
-- disqualify bracketing not directly followed by brace
- elseif encl == Enclosure.BRACKETED_DONE then
+ if encl == Enclosure.BRACKETED_DONE then
encl = Enclosure.NONE
end
- -- collect element, except in braced enclosure
- -- TODO: support mixed-use braced enclosure
- if encl ~= Enclosure.BRACED then
- elems:insert(el)
+ -- specific elements represent content enclosure
+ if encl == Enclosure.NONE then
+ if ElementTypeIsEnclosure[el.t] then
+ encl = Enclosure.BRACKETED_DONE
+ end
end
goto continue