Ir para o conteúdo

Módulo:Anchor

De DropWiki PoE 2
Revisão de 21h03min de 29 de janeiro de 2025 por 2804:7f0:b342:7285:2d1e:1c01:abfd:fada (discussão) (Criou página com 'local p = {} local getArgs function p.main(frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end local args = getArgs(frame, { wrappers = 'Template:Anchor', trim = false }) return p._main(args) end function p._main(args) local anchors = {} for k, v in pairs(args) do if type(k) == 'number' and k >= 1 and math.floor(k) == k and string.find(v, '%S') then table.insert(anchors, '<span id="' .. mw.text.trim(v) .. '"></span>') end e...')
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)


Lua logo

This module depends on the following other modules:

Implements {{Anchor}}.


local p = {}
local getArgs

function p.main(frame)
	if not getArgs then
		getArgs = require('Module:Arguments').getArgs
	end
	local args = getArgs(frame, {
		wrappers = 'Template:Anchor',
		trim = false
	})
	return p._main(args)
end

function p._main(args)
	local anchors = {}
	for k, v in pairs(args) do
		if type(k) == 'number' and k >= 1 and math.floor(k) == k and string.find(v, '%S') then
			table.insert(anchors, '<span id="' .. mw.text.trim(v) .. '"></span>')
		end
	end
	return table.concat(anchors)
end

return p