Module:Catalog lookup link/sandbox: Difference between revisions

Content deleted Content added
Create sandbox version of Module:Catalog lookup link
 
tweak output
Line 51:
return table.concat ({'[[', link, ']]'});
end
elseif is_set (args['article-name']display) then
return display
else
return '';
end
end
Line 69 ⟶ 71:
local article;
 
local article_postfix = args['article-postfix'] or ' ';
local link_prefix = args['link-prefix'] or '';
local link_postfix = args['link-postfix'] or '';
Line 75 ⟶ 77:
local item_postfix = args['item-postfix'] or '';
local list_separator = args['list-separator'] or ', ';
local leadout_postfix = args['leadout-postfix'] or ' ';
local list_leadout;
 
if is_set (args['list-leadout']) then
list_leadout = table.concat ({' ', args['list-leadout'], ' '});
mw.ustring.match(mw.ustring.sub(args['list-leadout'],1,1), '[%a]') and ' ' or '',
args['list-leadout'],
leadout_postfix,
});
else
list_leadout = '';
end
-- leadout-postfix?
 
if args['article-link'] or args['article-name'] then end
article = make_wikilink (args['article-link'], args['article-name']);
if is_set (article) then
article = table.concat ({article, article_postfix});
elseif is_set (args['article-name']) then
article = table.concat ({args['article-name'], article_postfix});
end
 
Line 117 ⟶ 122:
 
if is_set (args['list-leadout']) then
return table.concat ({article, ' ', mw.text.listToText (result, list_separator, list_leadout)});
else
return table.concat ({article, ' ', table.concat (result, list_separator)});
end
end