跳至內容

模組:Slight-pause mark list

出自微國家百科
於 2022年9月27日 (二) 11:11 由 imported>CYL992 所做的修訂 (建立內容為「require('Module:No globals') local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) -- Main module code goes here. local _args, countNil = {}, 0 for i = 1, math.huge do if args[i] then table.insert(_args, args[i]) countNil = 0 else countNil = countNil + 1 if countNil == 4 then break end end end if _args == {} then retur…」的新頁面)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)

可在模組:Slight-pause mark list/doc建立此模組的說明文件

require('Module:No globals')

local getArgs = require('Module:Arguments').getArgs
local p = {}

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	-- Main module code goes here.
	local _args, countNil = {}, 0

	for i = 1, math.huge do
		if args[i] then
			table.insert(_args, args[i])
			countNil = 0
		else
			countNil = countNil + 1
			if countNil == 4 then break end
		end
	end

	if _args == {} then
		return 
	end
	
	return '<span class="nowrap">' .. table.concat(_args, '</span>、<wbr /><span class="nowrap">') .. '</span>'
end

return p