Module:ImprovedReferences
Documentation for this module may be created at Module:ImprovedReferences/doc
local p = {}
function p.main(frame)
local args = frame:getParent().args
local out = {}
local i = 1
out[#out + 1] = '<ol class="references">'
while true do
local key = tostring(i)
local value = args[key]
if value == nil or mw.text.trim(value) == '' then
break
end
local rendered = frame:preprocess(value)
out[#out + 1] = string.format(
'<li id="cite-note-%d">%s <a href="#cite-ref-%d">↑</a></li>',
i, rendered, i
)
i = i + 1
end
out[#out + 1] = '</ol>'
return table.concat(out, '\n')
end
return p