Module:CS1 identifiers: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 177:
repeat -- loop until no
local params_t = params_get (args_t, i); -- get the parameters associated with enumerator <i>
params_t[template_name] = params_t[1] or params_t['id']; -- assign value from {{{1}}} or |id= to |<identifier>=
params_t._template = nil; -- unset as no longer needed
if not params_t[template_name] then -- in case params_t[1] and params_t.id are nil
params_t[template_name] = ''; -- set <id> to empty string
return render_final ( -- make an error message and done
return substitute ('<span class="cs1-visible-error citation-comment">' .. message_prefix .. '$1: required identifier missing ($2)</span>$3'; --, abandon when no identifier{
message_prefix,
substitute ('[[Template:$1|help]]', template_name),
no_cat and '' or substitute ('[[Category:Pages with $1 errors]]', template_name:upper())
}));
end
params_t[i] = nil; -- unset these as no longer needed