Изменения
дабы не образовывался лишний код при подстановке
local function wikilink(title, text, tooltip, lang)
local function wikilink(title, text, tooltip, lang)
if lang ~= nil and lang ~= 'ru' then
if lang ~= nil and lang ~= 'ru' then
title = string.format(':%s:%s', lang, title)
title = string.format(':%s:%s', lang, title)
end
end
if tooltip ~= nil then
if tooltip ~= nil then
if is_empty(text) then
text = title
end
text = tostring(
text = tostring(
mw.html.create('span')
mw.html.create('span')
)
)
end
end
return string.format('[[%s|%s]]', title, text)
if not is_empty(text) then
title = title .. '|' .. text
end
return string.format('[[%s]]', title)
end
end