Zum Inhalt springen

Modul:Check for unknown parameters: Unterschied zwischen den Versionen

Undid revision 880284391 by Frietjes (talk) didn't work
(try encoding instead, will revert if this doesn't work)
(Undid revision 880284391 by Frietjes (talk) didn't work)
Zeile 51: Zeile 51:
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) )  then
if not knownflag and ( not ignoreblank or isnotempty(v) )  then
k = mw.text.encode(mw.text.encode(k),'%c%[%]=%%')
k = mw.text.encode(mw.text.encode(k),'%c%[%]=')
table.insert(values, k)
table.insert(values, k)
end
end
Zeile 60: Zeile 60:
local vlen = mw.ustring.len(v)
local vlen = mw.ustring.len(v)
v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)
v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)
v = mw.text.encode(mw.text.encode(v),'%c%[%]=%%')
v = mw.text.encode(mw.text.encode(v),'%c%[%]=')
table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
end
end
Zeile 76: Zeile 76:
v = ' '
v = ' '
end
end
local r =  unknown:gsub('_VALUE_')
-- avoid error with v = 'example%2' ("invalid capture index")
local r =  unknown:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
table.insert(res, r)
end
end
Anonymer Benutzer