মডিউল:Check for unknown parameters: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
হালনাগাদ করা হয়েছে
সম্পাদনা সারাংশ নেই
১৬ নং লাইন:
local pargs = frame:getParent().args
local ignoreblank = isnotempty(frame.args['ignoreblank'])
local checkposshowblankpos = isnotempty(frame.args['checkpositionalshowblankpositional'])
local knownargs = {}
local unknown = frame.args['unknown'] or 'Found _VALUE_, '
local preview = frame.args['preview'] or unknown
 
local commentsvalues = {}
local res = {}
local regexps = {}
local comments = {}
local commentstr = ''
local ispreview = frame:preprocess( "{{REVISIONID}}" ) == "" and 1 or 0
if ispreview then ignoreblank = nil end
 
-- create the list of known args, regular expressions, and the return string
৩৮ ⟶ ৩৪ নং লাইন:
end
end
if isnotempty(frame.args['preview']) then
preview = '<div class="hatnote" style="color:red"><strong>Warningসতর্কীকরণ:</strong> ' .. frame.args['preview'] .. ' (thisএই messageবার্তা isশুধুমাত্র shownপ্রাকদর্শনে onlyদেখানো in previewহয়).</div>'
elseif frame.args['preview'] == nil then
preview = frame.args['preview']
else
preview = unknown
end
if ispreview == 1 then unknown = preview end
-- adds one result to the output tables
local function addresult(k)
if k == '' then
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
k = ' '
end
local r = unknown:gsub('_VALUE_', k)
table.insert(res, r)
table.insert(comments, '"' .. k .. '"')
end
 
৭১ ⟶ ৫২ নং লাইন:
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
addresulttable.insert(values, k)
end
elseif checkpostype(k) == 'number' and
type(k) == 'number' and
knownargs[tostring(k)] == nil and
( not ignoreblankshowblankpos or isnotempty(v) )
then
local vlen = mw.ustring.len(v)
addresult(k)
v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)
v = mw.ustring.gsub(v, '[^%w\-_ ]', '?')
table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
end
end
 
-- addsadd one resultresuls to the output tables
if #commentsvalues > 0 then
commentstr = '<!-- Module:Check for unknown parameters results: ' ..
local ispreview = if frame:preprocess( "{{REVISIONID}}" ) == "" and 1 or 0then
table.concat(comments, ', ') .. '-->'
unknown = preview
end
for k, v in pairs(values) do
if kv == '' then
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
kv = ' '
end
local r = unknown:gsub('_VALUE_', kv)
table.insert(res, r)
end
end
 
return table.concat(res) .. commentstr
end