Jump to content

Module:Anchor

Permanently protected module
From Wikipedia, the free encyclopedia

-- This module implements {{anchor}}.localgetArgs=require('Module:Arguments').getArgslocaltableTools=require('Module:TableTools')localp={}functionp.main(frame)-- Get the positional arguments from #invoke, remove any nil values,-- and pass them to p._main.localargs=getArgs(frame)localargArray=tableTools.compressSparseArray(args)returnp._main(unpack(argArray))endfunctionp._main(...)-- Generate the list of anchors.localanchors={...}localret={}for_,anchorinipairs(anchors)doret[#ret+1]='<span class="anchor" id="'..anchor..'"></span>'endreturntable.concat(ret)endreturnp
close