Module:Xpd

-- Expansion demo, like Template:Xpd

local p = {} function p.f(frame,sep) local r='' local t={} pframe = frame:getParent for n,v in pframe:argumentPairs do    if type(n)==number then t[n-1]=v else t[n]=v end end local tplname local tplargs={} tplargs[1]='' for n,v in pairs(t) do  if n==1 then tplname=v else tplargs[n]=v end end table.remove (tplargs,1) local w='' local wl=string.gsub (w, '&', '&amp;') wl=string.gsub (wl, '%[', '&#91;') wl=string.gsub (wl, '%]', '&#93;') wl=string.gsub (wl, '\n', ' ') wl=string.gsub (wl, ' ', ' ') r=r..' → ' r=r..sep..frame:preprocess (w) return r end function p.s(frame) local sep='' return p.f(frame,sep) end

function p.p(frame) local sep='\n\n' return p.f(frame,sep) end

return p