Изменения

дабы не образовывался лишний код при подстановке
Строка 7: Строка 7:     
local function wikilink(title, text, tooltip, lang)
 
local function wikilink(title, text, tooltip, lang)
if is_empty(text) then
  −
text = title
  −
end
   
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')
Строка 20: Строка 20:  
)
 
)
 
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
  
Анонимный участник