Module:String2/sandbox: Difference between revisions

Content deleted Content added
switching from :gsub to :match when possible
Tag: Reverted
Undid revision 1150328863 by Lemondoge (talk): silly me, that won't work if there are no matches
Line 317:
temp_str, accept = temp_str:gsub ('^%(%((.+)%)%)$', '%1') -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept ~= 0 then
temp_str = str:matchgsub ('^%(%((.+)%)%)$', '%1') -- when global markup removed, return original str; do it this way to suppress boolean second return value
end
return temp_str