বিষয়বস্তুতে চলুন

মডিউল:If empty: সংশোধিত সংস্করণের মধ্যে পার্থক্য

From ওয়ার্ল্ডপিডিয়া, the free encyclopedia
Changed protection settings for "Module:If empty": High-risk Lua module ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))
26 revisions imported
ট্যাগ: মোবাইল সম্পাদনা মোবাইল ওয়েব সম্পাদনা
 
(৩ জন ব্যবহারকারী দ্বারা সম্পাদিত ৩টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না)
৩ নং লাইন: ৩ নং লাইন:
function p.main(frame)
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
-- For backwards compatibility reasons, the first 8 parameters can be unset instead of being blank,
-- even though there's really no legitimate use case for this. At some point, this will be removed.
local lowestNil = math.huge
for i = 8,1,-1 do
if args[i] == nil then
args[i] = ''
lowestNil = i
end
end


for k,v in ipairs(args) do
for k,v in ipairs(args) do
if v ~= '' then
if v ~= '' then
if lowestNil < k then
-- If any uses of this template depend on the behavior above, add them to a tracking category.
-- This is a rather fragile, convoluted, hacky way to do it, but it ensures that this module's output won't be modified
-- by it.
frame:extensionTag('ref', '[[Category:Instances of Template:If_empty missing arguments]]', {group = 'TrackingCategory'})
frame:extensionTag('references', '', {group = 'TrackingCategory'})
end
return v
return v
end
end
end
end
end
end


return p
return p

০২:২০, ১৩ মার্চ ২০২৫ তারিখে সম্পাদিত সর্বশেষ সংস্করণ

এই মডিউলের জন্য মডিউল:If empty/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে

local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})

	for k,v in ipairs(args) do
		if v ~= '' then
			return v
		end
	end

end

return p