microsd卡是什么卡| 黑下打信是什么任务| 能的偏旁是什么| 蜈蚣怕什么| 免疫五项检查是什么| 用牙膏洗脸有什么好处和坏处| 尿白细胞定量高是什么意思| 有什么赚钱的软件| 直肠ca是什么意思| loa是什么意思| prc是什么| 梦见做棺材是什么意思| 小年吃什么| 路虎为什么叫奇瑞路虎| 313什么意思| 瘥是什么意思| 6月25日是什么星座| 男性b超检查什么项目| 什么是真菌| 吃维生素b2有什么好处和副作用| 阑尾炎吃什么| 钠低会出现什么症状| 女性排卵期有什么表现| 古代的天花是现代的什么病| 卵巢钙化灶是什么意思| 类风湿什么症状| 做梦梦见很多蛇是什么意思| 做爱都有什么姿势| 头疼想吐吃什么药| 山药有什么营养| 玄是什么颜色| y代表什么意思| 为的笔顺是什么| 馒头吃多了有什么坏处| 月经期间不能吃什么水果| 双肺钙化灶是什么意思| 夏枯草有什么作用| 霉菌是什么东西| 四个火念什么字| 牙龈萎缩吃什么药| 带环了月经推迟不来什么原因| 食物中毒有什么症状| 神经根型颈椎病吃什么药| 龟头有白色污垢是什么| 越南古代叫什么| 骨质疏松用什么药好| 勾魂是什么意思| les是什么意思| 子宫内膜炎吃什么药| 心绞痛用什么药最好| 心焦是什么意思| 农历十月初八是什么星座| 咽炎吃什么好| 赫尔墨斯是什么神| 国防部部长什么级别| 满天星是什么意思| 元胡是什么| 三个耳读什么| 乳腺无回声结节是什么意思| 现在摆摊卖什么东西最好卖| 尿液有泡沫是什么原因| 荔枝什么时候成熟| 卵巢黄体是什么意思| 酒后头疼什么原因| 什么叫多重耐药菌| 强迫思维是什么| 肚子胀气吃什么药| 姑爷是什么意思| 乂是什么意思| 什么是眩晕症| 1963年属什么生肖| 松鼠是什么生肖| 11月11日什么星座| 土生金是什么意思| 蒲公英和什么相克致死| 耳垂上有痣代表什么| 白带多是什么情况| 立加羽念什么| 肿瘤标志物是什么意思| 蚊子为什么吸血| 和解少阳是什么意思| 半年抛是什么意思| 计划生育什么时候开始的| 飞机杯长什么样| 鼻腔干燥是什么原因| 正常的月经是什么颜色| 猛吸气胸口疼什么原因| 心动过速吃什么药| 背痒是什么原因| 鲣鱼是什么鱼| 男人为什么会得前列腺炎| 骨相美是什么意思| 脑内多发缺血灶是什么意思| 抗核抗体弱阳性说明什么| 前白蛋白偏低是什么意思| 为什么一直打哈欠| 旅游有什么好处| 最高检检察长什么级别| 脂肪酶高是什么原因| 疾控中心是干什么的| 手麻木吃什么药好| 射精什么意思| 直肠ca是什么意思| 阔以是什么意思| 芙蓉花又叫什么花| 甲鱼吃什么的| 肚子胀气是什么原因| 999是什么电话| 持续高烧不退是什么原因| 属鼠是什么命| 为什么没有win9| 1988年是什么命| 献殷勤是什么意思| 脚指甲变白是什么原因| 薛之谦的真名叫什么| 腰间盘突出是什么症状| 蓝瘦香菇是什么意思| 微循环是什么意思| 10.5是什么星座| 除了胃镜还有什么检查胃的方法吗| 血小板低是什么引起的| 氢氧化钠是什么| 千张是什么| 好样的什么意思| 着床成功后有什么症状或感觉| 舌裂纹是什么原因| 稷是什么意思| 热疹子是什么症状图片| 飞机杯什么感觉| 皮肤黄适合穿什么颜色的衣服| 什么属于包皮过长| 干眼症用什么眼药水| 法医是干什么的| 俄罗斯和白俄罗斯有什么区别| 有点尿血是什么原因| 三岁属什么生肖| 蜻蜓是什么动物| 伪军是什么意思| 碳化是什么意思| 高汤是什么汤| 腰酸痛挂什么科| 军衔是什么意思| 脚底有黑痣有什么说法| 金钱草长什么样| 万箭穿心代表什么生肖| 盆腔炎什么症状| 蛮什么意思| 九霄云外是什么生肖| 包煎是什么意思| 高血压有什么症状表现| 男人硬不起来该吃什么药| 天德是什么生肖| 宝宝消化不良吃什么| 鼾症是什么病| 心跳太慢吃什么药| 张飞的兵器是什么| 吃什么增加白细胞最快| 阴道口痒是什么原因| 支原体感染是什么引起的| 宝宝打嗝是什么原因引起的| 猫爱吃什么| 丝瓜什么人不能吃| 眉毛长白毛是什么征兆| 橙色五行属什么| 366红包代表什么意思| aq是什么| 特别怕热爱出汗是什么原因| 感冒咳嗽挂号挂什么科| 保肝护肝吃什么药好| 温度计代表什么生肖| 8月7日是什么星座| 摩羯座喜欢什么样的女生| 劳您费心了什么意思| 奥林匹克精神是什么| 吃什么肝脏排毒| 喝最烈的酒下一句是什么| 胳膊脱臼什么症状| 1978年是什么命| 间接胆红素偏高是什么意思| 土豆什么时候收获| 翻什么覆什么| 嘴唇不红润是什么原因| 多囊卵巢综合征吃什么药| 秋田狐鱼钩适合钓什么鱼| 股癣用什么药最好| 近字五行属什么| 轻度贫血有什么症状| 鼻子发痒是什么原因引起的| 口吃什么意思| 小甲鱼吃什么| 寻常疣用什么药膏除根| 什么鱼不属于发物| napoleon是什么酒| 为什么纯牛奶容易爆痘| 11月份生日是什么星座| 牛的三合和六个合生肖是什么| 高山茶属于什么茶| 额头上长斑是什么原因造成的| 梦见拉麦子是什么预兆| 何五行属性是什么| 高丽参是什么参| 葡萄糖氯化钠注射作用是什么| 胸口疼应该挂什么科| 陌路人是什么意思| 手脚爱出汗是什么原因| 石女是什么意思啊| 汗多是什么原因| 马华念什么字| 什么样的细雨| 什么化痰效果最好最快| 过期的洗面奶可以用来做什么| 关东八大碗都有什么| 舌苔发黄厚是什么原因| 鼻子上的痣有什么寓意| 离苦得乐什么意思| cd56阳性是什么意思| 吃什么对肾有好处| 一血是什么意思| 杏子不能和什么一起吃| 肾主骨是什么意思| 什么饮料好喝| 肠息肉是什么症状| 怀孕什么时候开始孕吐| ct是什么| 精神卫生科看什么病| 三级残疾是什么程度| 三手烟是什么| lok是什么意思| 什么是脑白质病| 车厘子和樱桃有什么区别| 脑梗是什么| 1987属什么生肖| 单亲是什么意思| 转氨酶高挂什么科| 多吃洋葱有什么好处| ck属于什么档次的品牌| 扬字五行属什么| 如何查自己是什么命格| 黄泉是什么意思| 什么食物含碘高| 风致是什么意思| 爬山有什么好处| 冷面是用什么面做的| 篇幅是什么意思| 树叶又什么又什么| 4月出生是什么星座| 飞亚达手表什么档次| 四什么八什么的成语| 嘴麻是什么原因引起的| 96属什么生肖| 什么是闭口| 乏力是什么感觉| 尿检潜血是什么意思| 非主流什么意思| 忌讳是什么意思| 挚友是指什么的朋友| 66.66红包代表什么意思| 1997年是什么生肖| 稽是什么意思| 规培结束后是什么医生| 宫颈纳氏囊肿是什么意思| 抖m是什么| 心跳过速是什么原因| 浙江有什么城市| 百度

怀孕40天有什么症状

Belgekirina modulê[n??an bide] [biguhêre] [d?rokê bib?ne] [rojane bike]
百度 锂电池浑身都是宝,不怕没人处理。

Module:Infobox is a module that implements the {{Infobox}} template. Please see the template page for usage instructions.

Tracking categories

biguhêre

local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false

local function fixChildBoxes(sval, tt)
	local function notempty( s ) return s and s:match( '%S' ) end
	
	if notempty(sval) then
		local marker = '<span class=special_infobox_marker>'
		local s = sval
		-- start moving templatestyles and categories inside of table rows
		local slast = ''
		while slast ~= s do
			slast = s
			s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
			s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
		end
		-- end moving templatestyles and categories inside of table rows
		s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
		s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
		if s:match(marker) then
			s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
			s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
			s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
			s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
			s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
		end
		if s:match(marker) then
			local subcells = mw.text.split(s, marker)
			s = ''
			for k = 1, #subcells do
				if k == 1 then
					s = s .. subcells[k] .. '</' .. tt .. '></tr>'
				elseif k == #subcells then
					local rowstyle = ' style="display:none"'
					if notempty(subcells[k]) then rowstyle = ''	end
					s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
						subcells[k]
				elseif notempty(subcells[k]) then
					if (k % 2) == 0 then
						s = s .. subcells[k]
					else
						s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
							subcells[k] .. '</' .. tt .. '></tr>'
					end
				end
			end
		end
		-- the next two lines add a newline at the end of lists for the PHP parser
		-- [[Special:Diff/849054481]]
		-- remove when [[:phab:T191516]] is fixed or OBE
		s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
		s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
		s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
		s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
		return s
	else
		return sval
	end
end

-- Cleans empty tables
local function cleanInfobox()
	root = tostring(root)
	if has_rows == false then
		root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
	end
end

-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)

	local vals = {}
	for k, v in pairs(t1) do
		vals[v] = true
	end
	for k, v in pairs(t2) do
		vals[v] = true
	end
	local ret = {}
	for k, v in pairs(vals) do
		table.insert(ret, k)
	end
	return ret
end

-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
	local nums = {}
	for k, v in pairs(args) do
		local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
		if num then table.insert(nums, tonumber(num)) end
	end
	table.sort(nums)
	return nums
end

-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
	
	if rowArgs.header and rowArgs.header ~= '_BLANK_' then
		has_rows = true
		root
			:tag('tr')
				:addClass(rowArgs.rowclass)
				:cssText(rowArgs.rowstyle)
				:tag('th')
					:attr('colspan', '2')
					:addClass('infobox-header')
					:addClass(rowArgs.class)
					:addClass(args.headerclass)
					-- @deprecated next; target .infobox-<name> .infobox-header
					:cssText(args.headerstyle)
					:cssText(rowArgs.rowcellstyle)
					:wikitext(fixChildBoxes(rowArgs.header, 'th'))
		if rowArgs.data then
			root:wikitext(
				'[[Category:Pages using infobox templates with ignored data cells]]'
			)
		end
	elseif rowArgs.data and rowArgs.data:gsub(
			category_in_empty_row_pattern, ''
		):match('^%S') then
		has_rows = true
		local row = root:tag('tr')
		row:addClass(rowArgs.rowclass)
		row:cssText(rowArgs.rowstyle)
		if rowArgs.label then
			row
				:tag('th')
					:attr('scope', 'row')
					:addClass('infobox-label')
					-- @deprecated next; target .infobox-<name> .infobox-label
					:cssText(args.labelstyle)
					:cssText(rowArgs.rowcellstyle)
					:wikitext(rowArgs.label)
					:done()
		end

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', not rowArgs.label and '2' or nil)
			:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
			:addClass(rowArgs.class)
			-- @deprecated next; target .infobox-<name> .infobox(-full)-data
			:cssText(rowArgs.datastyle)
			:cssText(rowArgs.rowcellstyle)
			:wikitext(fixChildBoxes(rowArgs.data, 'td'))
	else
		table.insert(empty_row_categories, rowArgs.data or '')
	end
end

local function renderTitle()
	if not args.title then return end

	has_rows = true
	root
		:tag('caption')
			:addClass('infobox-title')
			:addClass(args.titleclass)
			-- @deprecated next; target .infobox-<name> .infobox-title
			:cssText(args.titlestyle)
			:wikitext(args.title)
end

local function renderAboveRow()
	if not args.above then return end

	has_rows = true
	root
		:tag('tr')
			:tag('th')
				:attr('colspan', '2')
				:addClass('infobox-above')
				:addClass(args.aboveclass)
				-- @deprecated next; target .infobox-<name> .infobox-above
				:cssText(args.abovestyle)
				:wikitext(fixChildBoxes(args.above,'th'))
end

local function renderBelowRow()
	if not args.below then return end

	has_rows = true
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '2')
				:addClass('infobox-below')
				:addClass(args.belowclass)
				-- @deprecated next; target .infobox-<name> .infobox-below
				:cssText(args.belowstyle)
				:wikitext(fixChildBoxes(args.below,'td'))
end

local function addSubheaderRow(subheaderArgs)
	if subheaderArgs.data and
		subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
		has_rows = true
		local row = root:tag('tr')
		row:addClass(subheaderArgs.rowclass)

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', '2')
			:addClass('infobox-subheader')
			:addClass(subheaderArgs.class)
			:cssText(subheaderArgs.datastyle)
			:cssText(subheaderArgs.rowcellstyle)
			:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
	else
		table.insert(empty_row_categories, subheaderArgs.data or '')
	end
end

local function renderSubheaders()
	if args.subheader then
		args.subheader1 = args.subheader
	end
	if args.subheaderrowclass then
		args.subheaderrowclass1 = args.subheaderrowclass
	end
	local subheadernums = getArgNums('subheader')
	for k, num in ipairs(subheadernums) do
		addSubheaderRow({
			data = args['subheader' .. tostring(num)],
			-- @deprecated next; target .infobox-<name> .infobox-subheader
			datastyle = args.subheaderstyle,
			rowcellstyle = args['subheaderstyle' .. tostring(num)],
			class = args.subheaderclass,
			rowclass = args['subheaderrowclass' .. tostring(num)]
		})
	end
end

local function addImageRow(imageArgs)

	if imageArgs.data and
		imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then

		has_rows = true
		local row = root:tag('tr')
		row:addClass(imageArgs.rowclass)

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', '2')
			:addClass('infobox-image')
			:addClass(imageArgs.class)
			:cssText(imageArgs.datastyle)
			:wikitext(fixChildBoxes(imageArgs.data, 'td'))
	else
		table.insert(empty_row_categories, imageArgs.data or '')
	end
end

local function renderImages()
	if args.image then
		args.image1 = args.image
	end
	if args.caption then
		args.caption1 = args.caption
	end
	local imagenums = getArgNums('image')
	for k, num in ipairs(imagenums) do
		local caption = args['caption' .. tostring(num)]
		local data = mw.html.create():wikitext(args['image' .. tostring(num)])
		if caption then
			data
				:tag('div')
					:addClass('infobox-caption')
					-- @deprecated next; target .infobox-<name> .infobox-caption
					:cssText(args.captionstyle)
					:wikitext(caption)
		end
		addImageRow({
			data = tostring(data),
			-- @deprecated next; target .infobox-<name> .infobox-image
			datastyle = args.imagestyle,
			class = args.imageclass,
			rowclass = args['imagerowclass' .. tostring(num)]
		})
	end
end

-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
	if not args.autoheaders then return end
	
	local rownums = union(getArgNums('header'), getArgNums('data'))
	table.sort(rownums)
	local lastheader
	for k, num in ipairs(rownums) do
		if args['header' .. tostring(num)] then
			if lastheader then
				args['header' .. tostring(lastheader)] = nil
			end
			lastheader = num
		elseif args['data' .. tostring(num)] and
			args['data' .. tostring(num)]:gsub(
				category_in_empty_row_pattern, ''
			):match('^%S') then
			local data = args['data' .. tostring(num)]
			if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
				lastheader = nil
			end
		end
	end
	if lastheader then
		args['header' .. tostring(lastheader)] = nil
	end
end

-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()

	local rownums = union(getArgNums('header'), getArgNums('data'))
	table.sort(rownums)
	for k, num in ipairs(rownums) do
		addRow({
			header = args['header' .. tostring(num)],
			label = args['label' .. tostring(num)],
			data = args['data' .. tostring(num)],
			datastyle = args.datastyle,
			class = args['class' .. tostring(num)],
			rowclass = args['rowclass' .. tostring(num)],
			-- @deprecated next; target .infobox-<name> rowclass
			rowstyle = args['rowstyle' .. tostring(num)],
			rowcellstyle = args['rowcellstyle' .. tostring(num)]
		})
	end
end

local function renderNavBar()
	if not args.name then return end

	has_rows = true
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '2')
				:addClass('infobox-navbar')
				:wikitext(require('Module:Navbar')._navbar{
					args.name,
					mini = 1,
				})
end

local function renderItalicTitle()
	local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
	if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
		root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
	end
end

-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
	for _, s in ipairs(empty_row_categories) do
		root:wikitext(s)
	end
end

-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
	if args.decat == 'yes' then return end
	if args.child == 'yes' then
		if args.title then
			root:wikitext(
				'[[Category:Pages using embedded infobox templates with the title parameter]]'
			)
		end
	elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
		root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
	end
end

--[=[
Loads the templatestyles for the infobox.

TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.

]=]
local function loadTemplateStyles()
	local frame = mw.getCurrentFrame()
	
	-- See function description
	local base_templatestyles = frame:extensionTag{
		name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
	}

	local templatestyles = ''
	if args['templatestyles'] then templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['templatestyles'] }
		}
	end
	
	local child_templatestyles = ''
	if args['child templatestyles'] then child_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['child templatestyles'] }
		}
	end
	
	local grandchild_templatestyles = ''
	if args['grandchild templatestyles'] then grandchild_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
		}
	end

	return table.concat({
		base_templatestyles, -- see function description
		templatestyles,
		child_templatestyles,
		grandchild_templatestyles
	})
end

-- common functions between the child and non child cases
local function structure_infobox_common()
	renderSubheaders()
	renderImages()
	preprocessRows()
	renderRows()
	renderBelowRow()
	renderNavBar()
	renderItalicTitle()
	renderEmptyRowCategories()
	renderTrackingCategories()
	cleanInfobox()
end

-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
	if args.child ~= 'yes' then
		root = mw.html.create('table')

		root
			:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
			:addClass(args.bodyclass)
			-- @deprecated next; target .infobox-<name>
			:cssText(args.bodystyle)

		renderTitle()
		renderAboveRow()
	else
		root = mw.html.create()

		root
			:wikitext(args.title)
	end
	structure_infobox_common()
	
	return loadTemplateStyles() .. root
end

-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
	if origArgs[argName] and origArgs[argName] ~= '' then
		args[argName] = origArgs[argName]
	end
end

-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
	if type(prefixTable) ~= 'table' then
		error("Non-table value detected for the prefix table", 2)
	end
	if type(step) ~= 'number' then
		error("Invalid step value detected", 2)
	end

	-- Get arguments without a number suffix, and check for bad input.
	for i,v in ipairs(prefixTable) do
		if type(v) ~= 'table' or type(v.prefix) ~= "string" or
			(v.depend and type(v.depend) ~= 'table') then
			error('Invalid input detected to preprocessArgs prefix table', 2)
		end
		preprocessSingleArg(v.prefix)
		-- Only parse the depend parameter if the prefix parameter is present
		-- and not blank.
		if args[v.prefix] and v.depend then
			for j, dependValue in ipairs(v.depend) do
				if type(dependValue) ~= 'string' then
					error('Invalid "depend" parameter value detected in preprocessArgs')
				end
				preprocessSingleArg(dependValue)
			end
		end
	end

	-- Get arguments with number suffixes.
	local a = 1 -- Counter variable.
	local moreArgumentsExist = true
	while moreArgumentsExist == true do
		moreArgumentsExist = false
		for i = a, a + step - 1 do
			for j,v in ipairs(prefixTable) do
				local prefixArgName = v.prefix .. tostring(i)
				if origArgs[prefixArgName] then
					-- Do another loop if any arguments are found, even blank ones.
					moreArgumentsExist = true
					preprocessSingleArg(prefixArgName)
				end
				-- Process the depend table if the prefix argument is present
				-- and not blank, or we are processing "prefix1" and "prefix" is
				-- present and not blank, and if the depend table is present.
				if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
					for j,dependValue in ipairs(v.depend) do
						local dependArgName = dependValue .. tostring(i)
						preprocessSingleArg(dependArgName)
					end
				end
			end
		end
		a = a + step
	end
end

-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()

	preprocessSingleArg('autoheaders')
	preprocessSingleArg('child')
	preprocessSingleArg('bodyclass')
	preprocessSingleArg('subbox')
	preprocessSingleArg('bodystyle')
	preprocessSingleArg('title')
	preprocessSingleArg('titleclass')
	preprocessSingleArg('titlestyle')
	preprocessSingleArg('above')
	preprocessSingleArg('aboveclass')
	preprocessSingleArg('abovestyle')
	preprocessArgs({
		{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
	}, 10)
	preprocessSingleArg('subheaderstyle')
	preprocessSingleArg('subheaderclass')
	preprocessArgs({
		{prefix = 'image', depend = {'caption', 'imagerowclass'}}
	}, 10)
	preprocessSingleArg('captionstyle')
	preprocessSingleArg('imagestyle')
	preprocessSingleArg('imageclass')
	preprocessArgs({
		{prefix = 'header'},
		{prefix = 'data', depend = {'label'}},
		{prefix = 'rowclass'},
		{prefix = 'rowstyle'},
		{prefix = 'rowcellstyle'},
		{prefix = 'class'}
	}, 50)
	preprocessSingleArg('headerclass')
	preprocessSingleArg('headerstyle')
	preprocessSingleArg('labelstyle')
	preprocessSingleArg('datastyle')
	preprocessSingleArg('below')
	preprocessSingleArg('belowclass')
	preprocessSingleArg('belowstyle')
	preprocessSingleArg('name')
	-- different behaviour for italics if blank or absent
	args['italic title'] = origArgs['italic title']
	preprocessSingleArg('decat')
	preprocessSingleArg('templatestyles')
	preprocessSingleArg('child templatestyles')
	preprocessSingleArg('grandchild templatestyles')
end

-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
	if frame == mw.getCurrentFrame() then
		origArgs = frame:getParent().args
	else
		origArgs = frame
	end
	
	parseDataParameters()
	
	return _infobox()
end

-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
	origArgs = {}
	for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
	
	parseDataParameters()
	
	return _infobox()
end
return p
头疼吃什么 4月23日什么星座 毛囊炎用什么药 日月星辰是什么意思 可孚属于什么档次
3月18日什么星座 950是什么金 朋友圈发女朋友照片配什么文字 cep是什么意思 茶毫是什么
kodak是什么牌子 一个白一个本是什么字 忌行丧是什么意思 内能与什么有关 乙肝表面抗原携带者什么意思
垂髫是什么意思 什么屁股摸不得 12月15是什么星座 莫代尔是什么面料 pnh是什么病的简称
为什么总长火疖子hcv9jop5ns5r.cn 1988属什么生肖hcv9jop0ns7r.cn 什么叫间质瘤shenchushe.com 房颤挂什么科hcv9jop1ns9r.cn 什么是禁欲hcv8jop1ns8r.cn
皮肤过敏吃什么药hcv7jop7ns4r.cn 分泌性中耳炎吃什么药hcv9jop5ns1r.cn 双肺索条灶是什么意思hcv8jop8ns0r.cn 3.19是什么星座hcv8jop8ns4r.cn 二聚体是什么意思hcv8jop2ns3r.cn
保育费是什么意思hcv9jop1ns3r.cn 尿酸偏高是什么病tiangongnft.com 梦到死人了有什么兆头hcv8jop9ns6r.cn 青鱼吃什么hcv8jop1ns0r.cn 阑尾炎挂什么科室wuhaiwuya.com
2006年是什么年hcv8jop5ns4r.cn 现在干什么挣钱hcv8jop7ns9r.cn 打蛔虫吃什么药hcv7jop9ns8r.cn 姨太太是什么意思hcv7jop7ns1r.cn 肺热咳嗽吃什么药hcv8jop5ns4r.cn
百度