Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,659
edits
m (pls) |
m (hm) |
||
Line 314: | Line 314: | ||
if link:sub ( 1,1 ) == '[' then | if link:sub ( 1,1 ) == '[' then | ||
local parentDiv = mw.html.create("a"):attr("href",link:sub ( 2,#link-1 )) | local parentDiv = mw.html.create("a"):attr("href",link:sub ( 2,#link-1 )) | ||
elseif link:sub ( 1,1 ) == '#' then | |||
local section_id = self.__source.ids[itemName].section | local section_id = self.__source.ids[itemName].section | ||
for index, tab in pairs(self.__source.sections) do | for index, tab in pairs(self.__source.sections) do | ||
if tab.id == section_id then | if tab.id == section_id then | ||
local parentDiv = mw.html.create("a"):attr("href","/" .. tab.name .. "/" .. link:sub ( 2,#link )) | local parentDiv = mw.html.create("a"):attr("href","/" .. tab.name .. "/" .. link:sub ( 2,#link )) | ||
end | end | ||
end | end | ||
elseif string.match(link, "%#") then | |||
local parentDiv = mw.html.create("a"):attr("href","/" .. link) | local parentDiv = mw.html.create("a"):attr("href","/" .. link) | ||
else | else | ||
local parentDiv = mw.html.create("a"):attr("href","/#" .. link) | local parentDiv = mw.html.create("a"):attr("href","/#" .. link) | ||
end | end | ||
parentDiv:node(sprite) | |||
return parentDiv | |||
end | end | ||
edits