From 271dafda87fc90d931794024a2d3d3a5f8b032c1 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 14 May 2025 19:07:00 +0200 Subject: fix collect post-enclosure string as such --- _extensions/ruc-play/semantic-markdown/semantic-markdown.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to '_extensions') diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua index ef55076..022e9de 100644 --- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua +++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua @@ -417,11 +417,6 @@ local function Statements (block) local _, nextpos4 = el.text:find(curie_pattern4, pos) local nextpos = nextpos1 or nextpos2 or nextpos3 or nextpos4 if nextpos then - statement_count = statement_count + 1 - pos = nextpos + 1 - - -- TODO: instead recursively call Statements() on remains of Str - chars_enclosed = chars_enclosed..el.text:sub(pos) -- qualify completed bracketed enclosure elems:extend(elems_enclosed) @@ -433,6 +428,12 @@ local function Statements (block) end chars_unenclosed = "" encl = Enclosure.NONE + + statement_count = statement_count + 1 + pos = nextpos + 1 + + -- TODO: instead recursively call Statements() on remains of Str + chars_unenclosed = chars_unenclosed..el.text:sub(pos) end end -- cgit v1.2.3