Изменения
Перейти к навигации
Перейти к поиску
Строка 76:
Строка 76:
− if isEmpty( link ) then
− html:wikitext( text )
−
− if hasCustomComment then
− html:addClass( defaultClass .. '-comment' )
− end
−
− return tostring( html )
− end
−
Строка 92:
Строка 82:
− +
+
+
+
+
Строка 98:
Строка 92:
− +
+
+
+
+
Модуль:Надстрочное предупреждение (посмотреть исходный код)
Версия от 00:52, 19 мая 2023
, 2 года назадупрощение кода
local function getLink( link, text, comment, hasCustomComment )
local function getLink( link, text, comment, hasCustomComment )
local html = mw.html.create( 'i' )
local html = mw.html.create( 'i' )
if not isEmpty( comment ) then
if not isEmpty( comment ) then
local span = mw.html.create( 'span' )
local span = mw.html.create( 'span' )
if hasCustomComment then
if hasCustomComment then
html:addClass( defaultClass .. '-commented' )
if isEmpty( link ) then
html:addClass( defaultClass .. '-comment' )
else
html:addClass( defaultClass .. '-commented' )
end
end
end
end
end
html:wikitext( string.format( '[[%s|%s]]', link, text ) )
if isEmpty( link ) then
html:wikitext( text )
else
html:wikitext( string.format( '[[%s|%s]]', link, text ) )
end
return tostring( html )
return tostring( html )
end
end