Content deleted Content added
←Created page with 'local p = {} function p.main(frame) local args = {} -- discard empty parameters and trim whitespace for k, v in frame:getParent().args do if v and mw.ust...' |
add lock icon |
||
Line 3:
function p.main(frame)
local args = {}
local defaultSeparator = ', '
local lockIcon = '<span style="padding-left: 0.15em;">[[File:Lock-green.svg|9px|link=|alt=Freely accessible|Freely accessible]]</span>'
-- discard empty parameters and trim whitespace
Line 9 ⟶ 12:
end
▲ local output = ''
if args[1] then
local i = 1
Line 17 ⟶ 19:
if args['article-link'] or args['article-name'] then
if args['article-link'] then
else
end
else
end
else -- otherwise, add separator
if ( (not args[i+1]) and args['list-leadout'] ) then -- if last item
if mw.ustring.match(mw.ustring.sub(args['list-leadout'],1,1), '[%a]') then
end
else -- if not last item or list-leadout isn't specified
end
end
Line 40 ⟶ 42:
if args['link-prefix'] then
item = '[' .. args['link-prefix'] .. mw.uri.encode(args[i]) .. (args['link-postfix'] or '') .. ' '.. item .. ']'
if args['lock-icon'] then
item = item .. lockIcon
end
end
i = i + 1
end
end
if args['lock-icon'] or args['plain-links'] then
return output▼
out = '<span class="plainlinks">' .. out .. '</span>'
end
end
|