-- This module implements {{anchor}}.
-- This is a modified version from [[wp:Module:Arguments]].
-- <nowiki>
local getArgs = require('Dev:Arguments').getArgs
-- [=[ Local implementation/mod of "compressSparseArray" ]=] ---------------------
local function compressSparseArray(t)
    local ret = {}; -- because freaking metatables
    for _,v in pairs(t) do
        if (v ~= nil) then ret[#ret + 1] = v; end;
    return ret;
-- [=[ Native program continues... ]=] -------------------------------------------
local p = {}
function p.main(frame)
	-- Get the positional arguments from #invoke, remove any nil values,
	-- and pass them to p._main.
	local args = getArgs(frame)
	local argArray = compressSparseArray(args)
	return p._main(unpack(argArray))
function p._main(...)
	-- Generate the list of anchors.
	local anchors = {...}
	local ret = {}
	for _, anchor in ipairs(anchors) do
		ret[#ret + 1] = '<span id="' .. anchor .. '"></span>'
	return table.concat(ret)
return p

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.