Content deleted Content added
sandbox |
text |
||
Line 12:
end
local function
return #notes == 0 and '' or
local note▼
local function formatName(internal, external, text)
table.insert(notes, 'redundant')
table.insert(notes, string.format('overrides "%s"', external))
end▼
local s = internal or external
table.insert(notes, string.format('label: "%s"', text))
end
return s .. addNotes(notes)
end
local function formatLink(internal, external, name)
local notes = {}
local generated = not internal and name and name ~= '' and name .. ' language'
if internal or generated then
if (internal or generated) == external then
elseif external then
local note = string.format('overrides [[%s]]', external)
▲ external,
local extTitle = mw.title.new(external)
▲ local intRedir = intTitle.redirectTarget
▲ intTitle = intRedir or intTitle
▲ local extTitle = mw.title.new(external)
▲ local extRedir = extTitle.redirectTarget
▲ extTitle = extRedir or extTitle
▲ if intTitle ~= extTitle then
▲ note = note .. ', a different article'
▲ end
end
table.insert(notes, note)
end
end
local s = generated or internal or external
▲ if link then
return s .. addNotes(notes)
▲ s = generated and '([[' .. s .. ']])' or '[[' .. s .. ']]'
▲ end
▲ if note then
▲ s = string.format('%s <small>(%s)</small>', s, note)
▲ end
end
Line 63 ⟶ 73:
table.insert(t, {
code = '<code>' .. code .. '</code>',
name =
link =
key = lect.key and '[[' .. lect.key .. ']]'
or '([[' .. (parent and parent.key or data.defaultKey) .. ']])'
|