Fix check for \i?clip in cleantags. Updates #1450.

Originally committed to SVN as r6452.
This commit is contained in:
Thomas Goyne 2012-02-07 01:23:00 +00:00
parent 26f3bb26ba
commit fcffb010b9

View file

@ -97,9 +97,9 @@ function cleantags(text)
end
--[[ Remove any spaces within parenteses within override blocks except for \clip tags ]]
local comb = function(a,b,c,d,e)
if c ~= "\\i?clip" or d:sub(-1):find("[,%({]") or e:sub(1,1):find("[,%)}]") then return a..b..d..e
else return a..b..d..string.char(2)..e end
local comb = function(a,b,c,d,e)
if (c ~= "\\clip" and c ~= "\\iclip") or d:sub(-1):find("[,%({]") or e:sub(1,1):find("[,%)}]") then return a..b..d..e
else return a..b..d..string.char(2)..e end
end
repeat
text, replaced2 = string.gsub(text, "({[^}\\]*)([^}%s]*(\\[^%(}\\%s]*))%s*(%([^%s%)}]*)%s+([^}]*)", comb)