diff options
| author | Jonas Smedegaard <dr@jones.dk> | 2025-05-11 13:08:15 +0200 |
|---|---|---|
| committer | Jonas Smedegaard <dr@jones.dk> | 2025-05-11 13:08:15 +0200 |
| commit | 392695a606ac0618ecfd74d92abf13f3d4feedb4 (patch) | |
| tree | 164344c7361a432f104f1a40f1fbf0e3a00852ae | |
| parent | 9b4c399e7ca433e3d2d6037bc17bb466cd2a299c (diff) | |
check non-Str element highest state first to support fall-through
| -rw-r--r-- | _extensions/ruc-play/semantic-markdown/semantic-markdown.lua | 23 |
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 |
