모듈:If empty: 두 판 사이의 차이

imported>IRTC1015
(추적용 분류 비활성화)
imported>Ykhwong
m ("모듈:If empty" 문서를 보호했습니다: 훼손시 영향이 큰 틀이나 모듈 ([편집=자동 인증된 사용자만 허용] (무기한) [이동=자동 인증된 사용자만 허용] (무기한)))
 
(차이 없음)

2021년 7월 10일 (토) 08:05 기준 최신판

이 모듈에 대한 설명문서는 모듈:If empty/설명문서에서 만들 수 있습니다

local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Ifempty', 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
		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', '[[분류:틀:Ifempty가 변수 없이 사용된 문서]]', {group = 'TrackingCategory'})
--				frame:extensionTag('references', '', {group = 'TrackingCategory'})
			end
			return v
		end
	end
end

return p
• 현재 페이지 URL 줄이기