When I use:
- text = string.gsub(text, "%%1", (v1 or "*") )
That fails as "invalid capture index"
Following my each day survey of MW version, the version where the bug appeared is
Mediawiki-Wikisource 1.29.0-wmf.3 (rMWc1e59aaed04f)-UTC-20161123-18:55
which I seen at 20161124-22:36 French time
To continue my work, I repair it using:
local j = string.find(text, "%", 1, true)
local k = string.find(text, "1", 1, true)
if j and k and ( j + 1 == k ) then
form = string.sub(form, 1, j-1) .. tostring(val) .. string.sub(form, k+1)
else
form = string.gsub(form or "gsub", "%%" .. S9, tostring(val) )
end