Module:Navbox: Difference between revisions

From Test Wiki
Content deleted Content added
pull navbar completely inside Lua
edge cases
Line 85: Line 85:
local class = 'noprint plainlinks hlist navbar';
local class = 'noprint plainlinks hlist navbar';
local title;
local title;
args[1] = trim( args[1] or '' );
if args[1] == '' then
if args[1] == '' then
title = mw.title.new( '' );
title = mw.title.new( '' );
elseif args[1]:sub(1,1) == ':' then
elseif args[1]:sub(1,1) == ':' then
title = mw.title.new( args[1] );
title = mw.title.new( args[1]:sub(2) );
else
else
title = mw.title.new( 'Template:' .. args[1] );
title = mw.title.new( 'Template:' .. args[1] );
end
end
local mainpage, talkpage, editurl;
local mainpage, talkpage, editurl;