יחידה:ParamValidator: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
כמקובל
ניסוי
שורה 148:
local capture = templateContent and mw.ustring.match( templateContent, '<templatedata%s*>(.*)</templatedata%s*>' ) -- templatedata as text
-- capture = capture and mw.ustring.gsub( capture, '"(%d+)"', tonumber ) -- convert "1": {} to 1: {}. frame.args uses numerical indexes for order-based params.
local trailingComma = capture and mw.ustring.find( capture, ',%s*[%]%}]' ) -- look for ,] or ,} : jsonDecode allows it, but it's verbotten in json
if capture and not tralingComma then return pcall( mw.text.jsonDecode, capture ) end
return false
end