aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-05-14 11:13:57 +0200
committerJonas Smedegaard <dr@jones.dk>2025-05-14 11:13:57 +0200
commitc3a1d4e8bc47a021548615bbe871e79b46d81222 (patch)
treece7ea2ba6baf54b4b07090dd1e47303c7e541426
parent2152d5e8512d78aee1dd0c77c7465bdd7dbc4f17 (diff)
rename variable chars_none -> chars_unenclosed
-rw-r--r--_extensions/ruc-play/semantic-markdown/semantic-markdown.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
index fe52cd3..1f22e64 100644
--- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
+++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua
@@ -295,7 +295,7 @@ local function Statements (block)
local pos = 1
-- strings of pending unenclosed/enclosed chars
- local chars_none = ""
+ local chars_unenclosed = ""
local chars_enclosed = ""
-- non-string element, highest state first to support fall-through
@@ -339,14 +339,14 @@ local function Statements (block)
if encl == Enclosure.NONE then
local _, nextpos, s = el.text:find("^([^%[\\]*)")
pos = nextpos and nextpos + 1 or pos + 1
- chars_none = chars_none..s
- chars_enclosed = chars_none
+ chars_unenclosed = chars_unenclosed..s
+ chars_enclosed = chars_unenclosed
-- entering bracketed enclosure
if el.text:sub(pos, pos) == "[" then
pos = pos + 1
- chars_enclosed = chars_none
- chars_none = chars_none.."["
+ chars_enclosed = chars_unenclosed
+ chars_unenclosed = chars_unenclosed.."["
encl = Enclosure.BRACKETED
end
end
@@ -357,13 +357,13 @@ local function Statements (block)
if encl == Enclosure.BRACKETED then
local _, nextpos, s = el.text:find("^([^%[%]}\\]*)", pos)
pos = nextpos and nextpos + 1 or pos + 1
- chars_none = chars_none..s
+ chars_unenclosed = chars_unenclosed..s
chars_enclosed = chars_enclosed..s
-- exiting bracketed enclosure
if el.text:sub(pos, pos) == "]" then
pos = pos + 1
- chars_none = chars_none.."]"
+ chars_unenclosed = chars_unenclosed.."]"
encl = Enclosure.BRACKETED_DONE
end
end
@@ -374,7 +374,7 @@ local function Statements (block)
-- entering braced enclosure
if el.text:sub(pos, pos) == "{" then
pos = pos + 1
- chars_none = chars_none.."{"
+ chars_unenclosed = chars_unenclosed.."{"
encl = Enclosure.BRACED
-- leaving non-annotation enclosure
@@ -384,9 +384,9 @@ local function Statements (block)
elems:extend(elems_unenclosed)
elems_unenclosed = pandoc.List()
elems_enclosed = pandoc.List()
- if chars_none:len() > 0 then
- elems:insert(pandoc.Str(chars_none))
- chars_none = ""
+ if chars_unenclosed:len() > 0 then
+ elems:insert(pandoc.Str(chars_unenclosed))
+ chars_unenclosed = ""
end
chars_enclosed = ""
encl = Enclosure.NONE
@@ -421,7 +421,7 @@ local function Statements (block)
elems:insert(pandoc.Str(chars_enclosed))
chars_enclosed = ""
end
- chars_none = ""
+ chars_unenclosed = ""
encl = Enclosure.NONE
end
end
@@ -430,8 +430,8 @@ local function Statements (block)
if chars_enclosed:len() > 0 then
elems_enclosed:insert(pandoc.Str(chars_enclosed))
end
- if chars_none:len() > 0 then
- elems_unenclosed:insert(pandoc.Str(chars_none))
+ if chars_unenclosed:len() > 0 then
+ elems_unenclosed:insert(pandoc.Str(chars_unenclosed))
end
-- done parsing current Inline element