Changes
Jump to navigation
Jump to search
Module:Footnotes
(view source)
Revision as of 12:06, 14 April 2017
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
WikiSysop
Bureaucrats
, private-view, public-view,
Administrators
97,692
edits
Navigation menu
Personal tools
Log in
Request account
Namespaces
Module
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Create New Page
Temples of India
Subscribe Dharmawiki
Recent changes
Random page
Author Help
Donate to Cause
Donate For Dharma
Tools
Special pages
Printable version