"ഘടകം:Anchor" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
mlwiki>Ranjithsiji (ചെ.) (en:Module:Anchor എന്നതിൽ നിന്ന് ഒരു പതിപ്പ് ഇറക്കുമതി ചെയ്തു) |
(ചെ.) (ഒരു പതിപ്പ് ഇറക്കുമതി ചെയ്തു: import user link template) |
(വ്യത്യാസം ഇല്ല)
|
12:47, 2 ജനുവരി 2021-നു നിലവിലുള്ള രൂപം
ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം:Anchor/വിവരണം എന്ന താളിൽ നിർമ്മിക്കാവുന്നതാണ്
-- This module implements {{anchor}}. local getArgs = require('Module:Arguments').getArgs local tableTools = require('Module:TableTools') 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 = tableTools.compressSparseArray(args) return p._main(unpack(argArray)) end function p._main(...) -- Generate the list of anchors. local anchors = {...} local ret = {} for _, anchor in ipairs(anchors) do ret[#ret + 1] = '<span class="anchor" id="' .. anchor .. '"></span>' end return table.concat(ret) end return p