什么是脑梗塞| 腿肿吃什么药消肿最快最有效| 一什么凤冠| nmd是什么的缩写| 胃反流吃什么药效果好| 荨麻疹是什么原因| 女性肝阳上亢吃什么药| 天是什么结构的字| 人文是什么意思| 三个子字念什么| 劫富济贫是什么意思| 吃牛肉有什么好处| 梦见狗是什么预兆| 暂缓参军是什么意思| 长期喝枸杞水有什么好处和坏处| 盗墓笔记的结局是什么| 刷牙时牙酸是什么原因| 四大菩萨分别保佑什么| 氟是什么东西| 水金龟属于什么茶| 雪茄为什么不过肺| 为什么水晶要消磁| 右下腹疼痛什么原因| 什么菜不能放醋| 脾是起什么作用的| 什么是友谊| 脖子长痘痘是因为什么原因| 乙肝两对半145阳性是什么意思| 辄的意思是什么| 金色葡萄球菌用什么药| 尿结石不能吃什么| 跳蚤咬了擦什么药最好| 切屏是什么意思| 叔叔的女儿叫什么| cheese是什么意思| 什么地唱歌| 是什么样的感觉我不懂是什么歌| 农历今年是什么年| 梦见自己刷牙是什么意思| 阿q精神是什么意思| 梦到和老公吵架是什么意思| 偏头痛看什么科| 鼻子出汗是什么原因| 丹毒病是什么原因引起的| 噗噗是什么意思| 先兆流产是什么原因| 嘘寒问暖是什么意思| 男人做什么运动能提高性功能| 得艾滋病的人有什么症状| 承你吉言是什么意思| 梦见莲藕是什么意思| 固摄是什么意思| 亚硝酸钠是什么| 孕妇肚子疼是什么原因| 七月十六是什么日子| 梦见下大雪是什么意思| 正常人突然抽搐是什么原因| 3月17日是什么星座| 检查糖尿病挂什么科| 犯花痴什么意思| 滑胎是什么意思| 冰片是什么| 胃气上逆吃什么中成药| 高密度灶是什么意思| 亦如是什么意思| 男人额头凹陷预示什么| 吃什么可以治痔疮| 谷丙转氨酶偏高吃什么好| 爬山需要准备什么东西| 肚子疼是什么病| 落户什么意思| 什么原因引起抽搐| 前任是什么意思| 12月初是什么星座| 为什么拍照脸是歪的| 血小板低有什么危险| 做噩梦是什么原因| 小排畸是什么检查| 热狗为什么叫热狗| 百依百顺是什么生肖| 什么是神经衰弱| 什么是精神出轨| 什么颜色衣服显白| 幼儿反复发烧是什么原因| 平躺头晕是什么原因| 花木兰属什么生肖| 朱允炆为什么不杀朱棣| 厅级是什么级别| 安徽有什么好吃的| 胯疼是什么原因| 心阳虚吃什么中成药| 盍是什么意思| crc是什么职业| 吃什么东西可以变白| 直男是什么意思| 孕早期胎停有什么症状或征兆吗| 尿胆原弱阳性什么意思| 冥想是什么| 冰妹什么意思| 龙傲天是什么意思| 两岁宝宝不会说话但什么都知道| 血糖高什么水果不能吃| 势不可挡是什么意思| 五月十七号是什么星座| 一事无成是什么生肖| 透析是什么病| 尿血是什么症状| 心电图可以检查出什么| 梦到和死人说话是什么意思| 心脏供血不足吃什么| 幽门螺旋杆菌阳性代表什么| 脑萎缩是什么原因引起的| 女人梦见狼是什么预兆| 武夷水仙茶属于什么茶| 灰指甲挂什么科室| 688是什么意思| 总是掉头发是什么原因| 孕妇鼻子出血是什么原因| 皮肤出现红点是什么原因| 红加绿是什么颜色| 六月二十九日是什么星座| ptsd是什么病| 有什么好吃的菜| 滑膜炎吃什么好得快| 晚上睡不着白天睡不醒是什么原因| 芳心是什么意思| 大便前面硬后面稀是什么原因| 脂蛋白a是什么意思| 包饺子什么意思| 宰相肚里能撑船是什么意思| 音欠读什么| 吃什么药可以流产不用去医院| 挂号是什么意思| 白头发多吃什么食物能变黑| 河南话信球是什么意思| 若什么若什么的成语| 5.8是什么星座| 吃什么补肺| 武夷水仙茶属于什么茶| 顿服是什么意思| 重阳节吃什么好| 血脂高看什么科| 神器积分换什么最划算| 人为什么需要诗歌| 睾丸炎吃什么药好得快| 刺身是什么鱼| 鸡枞是什么东西| 山楂和什么不能一起吃| 0706是什么星座| 小暑吃什么食物| total什么意思| 嗓子疼咳嗽吃什么药| 火红的什么| 什么是子宫憩室| 望洋兴叹是什么意思| 传染病八项包括什么| 圻字五行属什么| h是什么牌子的皮带| 合肥有什么玩的| 华盖是什么| 浩特是什么意思| 痛风有什么症状| 肠溶片是什么意思| 手淫多了有什么危害| 经常眩晕是什么原因引起的| 鬼火是什么| 口咸是什么原因引起的| 高中什么时候分文理科| 义眼是什么意思| 单纯疱疹病毒吃什么药| c反应蛋白偏高说明什么| 2027是什么年| 木耳菜不能和什么一起吃| 肛裂是什么原因造成的| 为什么叫智齿| 补血吃什么水果| 高锰酸钾治疗男性什么病| 周杰伦得了什么病| 香菜什么时候种最合适| 睡美人最怕得什么病| 女人手指粗短是什么命| 牙周炎吃什么药最有效| 滴滴是什么意思| 嗓子疼喝什么药| 口是什么感觉| 什么是室性早搏| 什么时候收花生| 力什么神什么| 白白的云朵像什么| 促黄体生成素是什么| 调理神经吃什么药好| 荆芥不能和什么一起吃| 姨妈血是黑褐色是什么原因| 长期不过性生活有什么危害| 孤军奋战是什么意思| 黄精为什么要九蒸九晒| 鹦鹉代表什么生肖| 宫颈管是什么| 助教是干什么的| 原住民是什么意思| 疣挂什么科| 歇菜是什么意思| 六月六日是什么节日| sneakers是什么意思| 高血糖可以吃什么水果| 城市的夜晚霓虹灯璀璨是什么歌| 母亲节送给妈妈什么礼物好| 外阴长水泡是什么原因| 什么东西可以去口臭呀| 竹外桃花三两枝的下一句是什么| 外阴白斑瘙痒用什么药| 脉数是什么意思| 鼠入牛角是什么动物| 西瓜红是什么颜色| 提莫是什么意思| 天蝎座是什么星象| 佩字五行属什么| 鼻梁痛什么原因引起的| 乳腺结节吃什么药好| b27是什么检查| hb是什么意思| 众望所归是什么意思| 什么叫精神分裂症| 反复高烧是什么原因| 社保卡属于什么银行| 五一广场有什么好玩的| 性生活是什么| 天干指的是什么| 心脏杂音是什么意思| 什么病不能吃阿胶| 一个王一个月念什么| 什么食物铅含量高| 肌酸激酶偏低说明什么| 1887年属什么生肖| 黑长直是什么意思| 奔富红酒属于什么档次| 上唇肿胀是什么原因| 耳加贵念什么| 九五至尊是什么生肖| 静脉曲张有什么表现| 犯困是什么原因| 六味地黄丸什么功效| 三无产品指的是什么| 河字五行属什么| 无什么无什么| 什么不安| 双子座男和什么座最配对| 张力是什么意思| 怀疑是什么意思| 伏天从什么时候开始| 青储是什么| 收缩压和舒张压是什么意思| 久站腰疼是什么原因| 裂帛是什么意思| 足底筋膜炎什么症状| 化疗病人吃什么好| 什么而不| 滚床单什么意思| 拉开帷幕是什么意思| xl代表什么尺码| 五脏六腑是什么意思| 精神焦虑症有什么表现有哪些| 半边脸疼是什么原因引起的| 疱疹性咽峡炎吃什么药最管用| 百度Jump to content

“HELLO小孩”公益项目走进青海玉树

From Wikiversity
百度 这种剑锋所指细大不捐、无远弗届的革命精神,既是我们党区别于其他政党的显著标志,也是我们党长盛不衰的重要保证。

Documentation for this module may be created at Module:Footnotes/doc

require('strict');
local getArgs = require ('Module:Arguments').getArgs;


--[[--------------------------< A R G S _ D E F A U L T >------------------------------------------------------

a table to specify initial values.

]]

local args_default = {
	bracket_left = '',
	bracket_right = '',
	bracket_year_left = '',
	bracket_year_right = '',
	postscript = '',
	page = '',
	pages = '',
	location = '',
	page_sep = ", p.&nbsp;",
	pages_sep = ", pp.&nbsp;",
	ref = '',
	template = 'harv',															-- if template name not provided in {{#invoke:}} use this
	};


--[[--------------------------< T A R G E T _ C H E C K >------------------------------------------------------

look for anchor_id (CITEREF name-list and year or text from |ref=) in anchor_id_list

the 'no target' error may be suppressed with |ignore-err=yes when target cannot be found because target is inside
a template that wraps another template; 'multiple targets' error may not be suppressed

]]

local function target_check (anchor_id, args)
	local namespace = mw.title.getCurrentTitle().namespace;
	local anchor_id_list_module = mw.loadData ('Module:Footnotes/anchor_id_list');
	local anchor_id_list = anchor_id_list_module.anchor_id_list;
	local article_whitelist = anchor_id_list_module.article_whitelist;
	local template_list = anchor_id_list_module.template_list;
	
	local whitelist_module = mw.loadData ('Module:Footnotes/whitelist');
	local whitelist = whitelist_module.whitelist;
	local special_patterns = whitelist_module.special_patterns;
	local DNB_special_patterns = whitelist_module.DNB_special_patterns;
	local DNB_template_names = whitelist_module.DNB_template_names;

	if 10 == namespace then
		return '';																-- automatic form of |no-tracking=yes; TODO: is this too broad?
	end

	local tally = anchor_id_list[anchor_id];									-- nil when anchor_id not in list; else a tally
	local msg;
	local category;

	if not tally then
		if args.ignore then
			return '';															-- if ignore is true then no message, no category
		end
		
		if article_whitelist and article_whitelist[anchor_id] then				-- if an article-local whitelist and anchor ID is in it
			return '';															-- done
		end
		
		local wl_anchor_id = anchor_id;											-- copy to be modified to index into the whitelist
		
		if args.year then														-- for anchor IDs created by this template (not in |ref=) that have a date
			if args.year:match ('%d%l$') or										-- use the date value to determine if we should remove the disambiguator
				args.year:match ('n%.d%.%l$') or
				args.year:match ('nd%l$') then
					wl_anchor_id = wl_anchor_id:gsub ('%l$', '');				-- remove the disambiguator
			end
		end		

		local t_tbl = whitelist[wl_anchor_id];									-- get list of templates associated with this anchor ID

		if t_tbl then															-- when anchor ID not whitelisted t_tbl is nil
			for _, t in ipairs (t_tbl) do										-- spin through the list of templates associated with this anchor ID
				if template_list[t] then										-- if associated template is found in the list of templates in the article
					return '';													-- anchor ID is whitlisted and article has matching template so no error
				end
			end
		end

		for _, pattern in ipairs (special_patterns) do							-- spin through the spcial patterns and try to match
			if anchor_id:match (pattern) then
				return '';
			end
		end

		for _, dnb_t in ipairs (DNB_template_names or {}) do					-- getting desparate now, are there any DNB templates? DNB_template_names may be nil; empty table prevents script error
			if template_list[dnb_t] then										-- if the article has this DNB template
				for _, pattern in ipairs (DNB_special_patterns) do				-- spin through the DNB-specifiec wildcard patterns
					if anchor_id:match (pattern) then							-- and attempt a match
						return '';												-- found a match
					end
				end
			end
		end

		msg = 'no target: ' .. anchor_id;										-- anchor_id not found
		category = '[[Category:Harv and Sfn no-target errors]]';

	elseif 1 < tally then
		msg = 'multiple targets (' .. tally .. '×): ' .. anchor_id;				-- more than one anchor_id in this article
		category = 0 == namespace and '[[Category:Harv and Sfn multiple-target errors]]' or '';								-- only categorize in article space
		return '<span class="error harv-error" style="display: inline; font-size:100%"> ' .. args.template .. ' error: ' .. msg .. ' ([[:Category:Harv and Sfn template errors|help]])</span>' .. category;
	end

--	category = 0 == namespace and '[[Category:Harv and Sfn template errors]]' or '';	-- only categorize in article space
	category = 0 == namespace and category or '';								-- only categorize in article space

--use this version to show error messages
--	return msg and '<span class="error harv-error" style="display: inline; font-size:100%"> ' .. args.template .. ' error: ' .. msg .. ' ([[:Category:Harv and Sfn template errors|help]])</span>' .. category or '';
--use this version to hide error messages
	return msg and '<span class="error harv-error" style="display: none; font-size:100%"> ' .. args.template .. ' error: ' .. msg .. ' ([[:Category:Harv and Sfn template errors|help]])</span>' .. category or '';

end


--[[--------------------------< I S _ Y E A R >----------------------------------------------------------------

evaluates param to see if it is one of these forms with or without lowercase letter disambiguator:
	YYYY
	n.d.
	nd	
	c. YYYY
	YYYY–YYYY	(separator is endash)
	YYYY–YY		(separator is endash)

return true when param has a recognized form; false else

]]

local patterns_date= {
	'^%d%d%d%d?%l?$',
	'^n%.d%.%l?$',
	'^nd%l?$',
	'^c%. %d%d%d%d?%l?$',
	'^%d%d%d%d–%d%d%d%d%l?$',
	'^%d%d%d%d–%d%d%l?$',
	}

local function is_year (param, args)
	args.year = '';																-- used for harv error; 
	
	for _, pattern in ipairs (patterns_date) do
		if mw.ustring.match (param, pattern) then
			args.year = param;													-- used for harv error; 
			return true;
		end
	end
end


--[[--------------------------< C O R E >----------------------------------------------------------------------

returns an anchor link (CITEREF) formed from one to four author names, year, and insource location (|p=, |pp=, loc=)

]]

local function core( args )
	local result;
	local err_msg = ''

	if args.P5 ~= '' then
		if is_year (args.P5, args) then
			result = table.concat ({args.P1, ' et al. ', args.bracket_year_left, args.P5, args.bracket_year_right});
		else
			args.P5 = '';														-- when P5 not a year don't include in anchor
			result = table.concat ({args.P1, ' et al.'});						-- and don't render it
		end

	elseif args.P4 ~= '' then
		if is_year (args.P4, args) then
			result = table.concat ({args.P1, ', ', args.P2, ' &amp; ', args.P3, ' ', args.bracket_year_left, args.P4, args.bracket_year_right});	-- three names and a year
		else
			result = table.concat ({args.P1, ' et al.'});						-- four names
		end

	elseif args.P3 ~= '' then
		if is_year (args.P3, args) then
			result = table.concat ({args.P1, ' &amp; ', args.P2, ' ', args.bracket_year_left, args.P3, args.bracket_year_right});	-- two names and a year
		else
			result = table.concat ({args.P1, ', ', args.P2, ' ', ' &amp; ', args.P3});	-- three names
		end
			
	elseif args.P2 ~= '' then
		if is_year (args.P2, args) then
			result = table.concat ({args.P1, ' ', args.bracket_year_left, args.P2, args.bracket_year_right});	-- one name and year
		else
			result = table.concat ({args.P1, ' &amp; ', args.P2});				-- two names
		end
		
	else
		result = args.P1;														-- one name
	end
																				-- when author-date result ends with a dot (typically when the last positional parameter holds 'n.d.')
																				-- and when no in-source location (no |p=, |pp=, or |loc=)
																				-- and when the first or only character in args.postscript is a dot
																				-- remove the author-date result trailing dot
																				-- the author-date result trailing dot will be replaced later with the content of args.postscript (usually a dot)
	if ('.' == result:sub(-1)) and ('.' == args.postscript:sub(1)) and ('' == args.page) and ('' == args.pages) and ('' == args.location) then
		result = result:gsub ('%.$', '');
	end
	
	if args.ref ~= 'none' then
		local anchor_id;
		if args.ref ~= '' then
			anchor_id = mw.uri.anchorEncode (args.ref);
			err_msg = target_check (anchor_id, args);
			result = table.concat ({'[[#', anchor_id, '|', result, ']]'});
		else
			anchor_id = mw.uri.anchorEncode (table.concat ({'CITEREF', args.P1, args.P2, args.P3, args.P4, args.P5}));
			err_msg = target_check (anchor_id, args);
			result = table.concat ({'[[#', anchor_id, '|', result, ']]'});
		end
	end

	if args.page ~= '' then
		result = table.concat ({result, args.page_sep, args.page});
	elseif args.pages ~= ''then
		result = table.concat ({result, args.pages_sep, args.pages});
	end      

	if args.location ~= '' then
		result = table.concat ({result, ', ', args.location});
	end

	result = table.concat ({args.bracket_left, result, args.bracket_right, args.postscript}):gsub ('%s+', ' ');		-- strip redundant spaces
	return result .. err_msg;
end


--[[--------------------------< A R G S  _ F E T C H >---------------------------------------------------------

Because all of the templates share a common set of parameters, a single common function to fetch those parameters
from frame and parent frame.

]]

local function args_fetch (frame, ps)
	local args = args_default;													-- create a copy of the default table
	local pframe = frame:getParent();											-- point to the template's parameter table

	for k, v in pairs (frame.args) do											-- override defaults with values provided in the #invoke: if any
		args[k] = v;	   
	end
	
	args.postscript = pframe.args.postscript or pframe.args.ps or ps;
	if 'none' == args.postscript then
		args.postscript = '';
	end
	args.page = pframe.args.p or pframe.args.page or '';
	args.pages = pframe.args.pp or pframe.args.pages or '';
	args.location = pframe.args.loc or '';
	args.ref = pframe.args.ref or pframe.args.Ref or '';
	args.ignore = ('yes' == pframe.args['ignore-false-positive']) or ('yes' == pframe.args['ignore-err']);

	for i, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do						-- loop through the five positional parameters and trim if set else empty string
		args[v] = (pframe.args[i] and mw.text.trim (pframe.args[i])) or '';
	end

	if args.P5 and not is_year (args.P5, args) then
		local i = 6;															-- initialize the indexer to the sixth positional parameter
		while pframe.args[i] do													-- in case there are too many authors loop through the authors looking for a year
			local v = mw.text.trim (pframe.args[i]);							-- trim
			if is_year (v, args) then											-- if a year
				args.P5 = v;													-- overwrite whatever was in args.P5 with year
				break;															-- and abandon the search
			end
			i = i + 1;															-- bump the indexer
		end
	end
	return args;
end


--[[--------------------------< H A R V A R D _ C I T A T I O N >----------------------------------------------

common entry point for:
	{{harvard citation}} aka {{harv}}
	{{Harvard citation no brackets}} aka {{harvnb}}
	{{harvcol}}
	{{harvcolnb}}
	{{harvcoltxt}}
	{{Harvard citation text}} aka {{harvtxt}}
	{{Harvp}}

Distinguishing features (brackets and page separators) are specified in this module's {{#invoke}} in the respective templates.

]]

local function harvard_citation (frame)
	local args = args_fetch (frame, '');										-- get the template and invoke parameters; default postscript is empty string

	return core (args);
end


--[[--------------------------< S T R I P _ U R L >------------------------------------------------------------

used by sfn() and sfnm().  This function fixes an issue with reference tooltip gadget where the tooltip is not displayed
when an insource locator (|p=, |pp=, |loc=) has an external wikilink that contains a # character

strip uri-reserved characters from urls in |p=, |pp-, and |loc= parameters  The researved characters are:
	!#$&'()*+,/:;=?@[]
	
]]

local function strip_url (pages)
	local escaped_uri;
	if not pages or ('' == pages) then
		return pages;
	end
	
	for uri in pages:gmatch ('%[(%a[%w%+%.%-]*://%S+)') do						-- for each external link get the uri
		escaped_uri = uri:gsub ("([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );		-- save a copy with lua pattern characters escaped
		uri = uri:gsub ("[!#%$&'%(%)%*%+,/:;=%?@%[%]%.%%]", '');				-- remove reserved characters and '%' because '%20' (space character) is a lua 'invalid capture index'
		pages = pages:gsub (escaped_uri, uri, 1);								-- replace original uri with the stripped version
	end
	
	return pages;
end


--[[--------------------------< S F N >------------------------------------------------------------------------

entry point for {{sfn}} and {{sfnp}}

]]

local function sfn (frame)
	local args = args_fetch (frame, '.');										-- get the template and invoke parameters; default postscript is a dot

	local result = core (args);													-- go make a CITEREF anchor
																				-- put it all together and then strip redundant spaces
	local name = table.concat ({'FOOTNOTE', args.P1, args.P2, args.P3, args.P4, args.P5, strip_url (args.page), strip_url (args.pages), strip_url (args.location)}):gsub ('%s+', ' ');

	return frame:extensionTag ({name='ref', args={name=name}, content=result});	

	
end


--[[--------------------------< S F N M >----------------------------------------------------------------------

common entry point for {{sfnm}} and {{sfnmp}}

Distinguishing features (brackets) are specified in this module's {{#invoke}} in the respective templates.

]]

local function sfnm (frame)
	local args = args_default;													-- create a copy of the default table
	local pframe = frame:getParent();											-- point to the template's parameter table
	
	local n = 1;																-- index of source; this is the 'n' in na1, ny, etc
	local first_pnum = 1;														-- first of a pair of positional parameters
	local second_pnum = 2;														-- second of a pair of positional parameters

	local last_ps = 0;															-- index of the last source with |nps= set
	local last_index = 0;														-- index of the last source; these used to determine which of |ps= or |nps= will terminate the whole rendering

	local out = {};																-- table to hold rendered sources
	local footnote = {'FOOTNOTE'};												-- all author, date, insource location stuff becomes part of the reference's footnote id; added as we go

	for k, v in pairs (frame.args) do											-- override defaults with values provided in the #invoke: if any
		args[k] = v;	   
	end
	
	while true do
		if not pframe.args[table.concat ({n, 'a1'})] and not pframe.args[first_pnum] then
			break;																-- no na1 or matching positional parameter so done
		end
		
		if pframe.args[table.concat ({n, 'a1'})] then							-- does this source use named parameters?
			for _, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do				-- initialize for this source
				args[v] = '';
			end

			for i, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do				-- extract author and year parameters for this source
				args[v] = pframe.args[table.concat ({n, 'a', i})] or '';		-- attempt to assign author name
				if '' == args[v] then											-- when there wasn't an author name
					args[v] = pframe.args[table.concat ({n, 'y'})] or '';		-- attempt to assign year
					break;														-- done with author/date for this source
				end
			end

		else																	-- this source uses positional parameters
			args.P1 = mw.text.trim (pframe.args[first_pnum]);					-- yes, only one author supported
			args.P2 = (pframe.args[second_pnum] and mw.text.trim (pframe.args[second_pnum])) or '';	-- when positional author, year must also be positional

			for _, v in ipairs ({'P3', 'P4', 'P5'}) do							-- blank the rest of these for this source
				args[v] = '';
			end

			first_pnum = first_pnum + 2;										-- source must use positional author and positional year
			second_pnum = first_pnum + 1;										-- bump these for possible next positional source
		end
		
		args.postscript = pframe.args[table.concat ({n, 'ps'})] or '';
		if 'none' == args.postscript then										-- this for compatibility with other footnote templates; does nothing
			args.postscript = '';
		end

		args.ref = pframe.args[table.concat ({n, 'ref'})] or '';				-- alternate reference for this source

		args.page = pframe.args[table.concat ({n, 'p'})] or '';					-- insource locations for this source
		args.pages = pframe.args[table.concat ({n, 'pp'})] or '';
		args.location = pframe.args[table.concat ({n, 'loc'})] or '';
		args.ignore = ('yes' == pframe.args[table.concat ({n, 'ignore-false-positive'})]) or ('yes' == pframe.args[table.concat ({n, 'ignore-err'})]);
--		args.ignore = 'yes' == pframe.args[table.concat ({n, 'ignore-err'})];

		table.insert (out, core (args));										-- save the rendering of this source
		
		for k, v in ipairs ({'P1', 'P2', 'P3', 'P4', 'P5'}) do					-- create the FOOTNOTE id
			if '' ~= args[v] then
				table.insert (footnote, args[v]);
			end
		end
		for k, v in ipairs ({'page', 'pages', 'location'}) do					-- these done separately so that we can strip uri-reserved characters from extlinked page numbers 
			if '' ~= args[v] then
				table.insert (footnote, strip_url (args[v]))
			end
		end
		
		last_index = n;															-- flags used to select terminal postscript from nps or from end_ps
		if '' ~= args.postscript then							
			last_ps = n;
		end
		
		n = n+1;																-- bump for the next one
	end
	
	local name = table.concat (footnote):gsub ('%s+', ' ');						-- put the footnote together and strip redundant space
	
	args.end_ps = pframe.args.postscript or pframe.args.ps or '.';				-- this is the postscript for the whole not for the individual sources
	if 'none' == args.end_ps then												-- not an original sfnm parameter value; added for compatibility with other footnote templates
		args.end_ps = '';
	end

	local result = table.concat ({table.concat (out, '; '), (last_index == last_ps) and '' or  args.end_ps});
	return frame:extensionTag ({name='ref', args={name=name}, content=result});
end


--[[--------------------------< S F N R E F >------------------------------------------------------------------

implements {{sfnref}}

]]

local function sfnref (frame)
	local args = getArgs (frame);
	local out = {};
	
	for i=1, 5 do																-- get the first five args if there are five args
		if args[i] then
			out[i] = args[i];
		else
			break;																-- less than 5 args break out
		end
	end
	
	if 5 == #out then															-- when we have seen five args there may bemore
		local i = 6;															-- initialize the indexer to the sixth positional parameter
		while args[i] do														-- in case there are too many authors loop through the authors looking for a year
			if is_year (args[i], args) then										-- if a year
				out[5] = args[i];												-- overwrite whatever was in args[5] with year
				break;															-- and abandon the search
			end
			i = i + 1;															-- bump the indexer
		end
	end
	
	return mw.uri.anchorEncode ('CITEREF' .. table.concat (out));
end


--[[--------------------------< E X P O R T E D   F U N C T I O N S >------------------------------------------
]]

return {
	harvard_citation = harvard_citation,
	sfn = sfn,
	sfnm = sfnm,
	sfnref = sfnref,
	};
ahc是韩国什么档次 后嗣是什么意思 哥伦比亚牌子什么档次 月亮发红是什么原因 下午5点到7点是什么时辰
10月底是什么星座 为什么说冬吃萝卜夏吃姜 尿道口有烧灼感为什么 嘴唇痒边缘痒用什么药 宵夜吃什么
欧米茄什么意思 城五行属什么 亭亭净植是什么意思 儿童抗o高会引起什么病 choker是什么意思
中午十一点是什么时辰 右脸颊长痘是什么原因 数目是什么意思 车厘子和樱桃什么区别 m是什么码
吃什么去胃火口臭hcv8jop4ns8r.cn 12月是什么星座的hcv8jop1ns8r.cn 天长地久是什么意思hcv7jop7ns0r.cn 子宫为什么会长息肉hcv7jop9ns0r.cn 公安局大队长是什么级别hcv7jop4ns8r.cn
霉菌性阴道炎是什么原因引起的hcv8jop9ns9r.cn 草木皆兵是什么生肖hcv9jop5ns0r.cn 泌乳素高有什么症状hcv8jop3ns0r.cn 三班倒什么意思hcv9jop0ns4r.cn 脖子上长癣是什么原因qingzhougame.com
二月十七是什么星座hcv8jop2ns1r.cn 45岁属什么的生肖hcv9jop1ns8r.cn sk是什么hcv9jop5ns7r.cn 完美落幕是什么意思kuyehao.com 什么牙膏最好hcv9jop4ns0r.cn
天成是什么意思hcv9jop5ns3r.cn 检查鼻炎要做什么检查beikeqingting.com 乳头瘤有什么症状hcv8jop5ns1r.cn 1114是什么星座hcv7jop9ns1r.cn 黑裤子配什么颜色上衣hcv7jop6ns5r.cn
百度