Changes

45 bytes added ,  22:13, 2 September 2019
no edit summary
Line 1,659: Line 1,659:     
]]
 
]]
max = 1;
+
 
 
local function get_display_names (max, count, list_name, etal)
 
local function get_display_names (max, count, list_name, etal)
if is_set (max) then
+
        local border = 1;
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
+
if is_set (border) then
max = count + 1; -- number of authors + 1 so display all author name plus et al.
+
if 'etal' == border:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
 +
border = count + 1; -- number of authors + 1 so display all author name plus et al.
 
etal = true; -- overrides value set by extract_names()
 
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
+
elseif border:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
+
border = tonumber (max); -- make it a number
if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
+
if border >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
 
add_maint_cat ('disp_name', cfg.special_case_translation [list_name]);
 
add_maint_cat ('disp_name', cfg.special_case_translation [list_name]);
 
end
 
end
 
else -- not a valid keyword or number
 
else -- not a valid keyword or number
table.insert( z.message_tail, { set_error( 'invalid_param_val', {'display-' .. list_name, max}, true ) } ); -- add error message
+
table.insert( z.message_tail, { set_error( 'invalid_param_val', {'display-' .. list_name, border}, true ) } ); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
+
border = nil; -- unset; as if |display-xxxxors= had not been set
 
end
 
end
 
end
 
end
 
 
return max, etal;
+
return border, etal;
 
end
 
end