diff options
Diffstat (limited to '_extensions')
| -rw-r--r-- | _extensions/ruc-play/semantic-markdown/semantic-markdown.lua | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua index 4135ccb..1dc17aa 100644 --- a/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua +++ b/_extensions/ruc-play/semantic-markdown/semantic-markdown.lua @@ -164,7 +164,7 @@ function Statements (block) if el.t == 'Str' and not (bracketed or braced) then _, a, pre = string.find(el.text, "([^\\]?)%[") if a and pre == '' then - bracketed = 1 + bracketed = true pos = a + 1 end end @@ -178,14 +178,14 @@ function Statements (block) -- entering braced enclosure if el.text:sub(c, c) == "{" then - braced = 1 + braced = true pos = c + 1 table.insert(new_inlines, pandoc.Str(s)) -- leaving non-annotation enclosure else - bracketed = 0 - braced = 0 + bracketed = false + braced = false end end end @@ -197,15 +197,19 @@ function Statements (block) _, d = string.find(el.text, "^"..curie_long.."}", pos) if d then statement_count = statement_count + 1 + bracketed = false + braced = false + pos = d + 1 + -- TODO: add any bracket-enclosed content to stack -- TODO: call same function with remains of Str end - end + else table.insert(new_inlines, el) + end + end + if statement_count > 0 then + return pandoc.Blocks {new_inlines} end --- FIXME --- if statement_count then --- return pandoc.Inlines {new_inlines} --- end end -- First resolve namespace declarations, then statements. |
