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