From 3f1f2d11ce0b89e7084905c4a0111b7d84455a60 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 28 May 2018 13:57:58 +0200 Subject: tightened some Pegs --- arabluatex.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arabluatex.lua b/arabluatex.lua index 3e7dd96..b99fbca 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -81,7 +81,7 @@ local bsqbrackets = lpeg.Cs{ "[" * ((1 - lpeg.S"[]") + lpeg.V(1))^0 * "]" } local bcbraces = lpeg.Cs{ "{" * ((1 - lpeg.S"{}") + lpeg.V(1))^0 * "}" } local spce = lpeg.P(" ") local bsqbracketsii = lpeg.Cs(bsqbrackets^-2) -local bcbracesii = lpeg.Cs(spce^-1 * bcbraces * spce^-1 * bcbraces^-1) +local bcbracesii = lpeg.Cs(bcbraces * bcbraces^-1) local function breakcmd(str) for i = 1,#albrkcmds do @@ -95,7 +95,7 @@ local function breakcmd(str) str = gsub(str, dblbkslash * lpeg.Cs(brkcmds[i]) * spce^-1 * bsqbracketsii * bcbracesii, "}%1%2%3%4\\arb{") end end - -- process \item[], then \item[] + -- process \item[], then \item str = string.gsub(str, "\\(item.?)(%b[])", function(tag, body) body = string.sub(body, 2, -2) -- cgit v1.2.3