Changes

Jump to navigation Jump to search
706 bytes added ,  12:06, 14 April 2017
m
1 revision imported
Line 29: Line 29:  
function core( args )
 
function core( args )
 
local result;
 
local result;
 
+
--TODO: evaluate to make sure that the following if correctly handles the parameter set when there is no year
 
if args.P5 ~= "" then
 
if args.P5 ~= "" then
 
result = args.P1 .. ' et al. ' .. args.bracket_year_left .. args.P5 ..  
 
result = args.P1 .. ' et al. ' .. args.bracket_year_left .. args.P5 ..  
Line 39: Line 39:  
result = args.P1 .. ' & ' .. args.P2 .. ' ' .. args.bracket_year_left ..  
 
result = args.P1 .. ' & ' .. args.P2 .. ' ' .. args.bracket_year_left ..  
 
args.P3 .. args.bracket_year_right;
 
args.P3 .. args.bracket_year_right;
 +
elseif args.P2 ~= "" then
 +
if not args.P2:match ('%d%d%d%d') and not args.P2:match ('n%.d%.') and not args.P2:match ('nd') and not args.P2:match ('c%. %d%d%d%d?%c?') then
 +
result = args.P1 .. ' & ' .. args.P2; -- for the case where the last numbered parameter is a name and not a year and not no-date
 +
else
 +
result = args.P1 .. ' ' .. args.bracket_year_left .. args.P2 .. args.bracket_year_right;
 +
end
 
else
 
else
 
result = trim( args.P1 .. ' ' .. args.bracket_year_left .. args.P2 ..  
 
result = trim( args.P1 .. ' ' .. args.bracket_year_left .. args.P2 ..  
Line 44: Line 50:  
end
 
end
    +
if ('.' == result:sub(-1)) and ('' == args.page) and ('' == args.pages) and ('' == args.location) then
 +
args.postscript = ''; -- prevent double periods when date is 'n.d.'
 +
end
 +
 
if args.ref ~= 'none' then
 
if args.ref ~= 'none' then
 
if args.ref ~= "" then
 
if args.ref ~= "" then
Bureaucrats, private-view, public-view, Administrators
97,692

edits

Navigation menu