阴道口出血是什么原因| 集成灶什么品牌最好| 吃糖醋蒜有什么好处和坏处| 输钾为什么会痛| 什么症状吃柏子养心丸| 睡不着吃什么药最有效| 点茶是什么意思| 产妇吃什么鸡最好| 双子是什么星座| 身价是什么意思| 25是什么生肖| 为什么会尿床| 流感吃什么药| 看静脉曲张挂什么科| 脸上过敏擦什么药膏| 产品批号什么意思| 7月1日是什么节| 喝茶叶茶有什么好处和坏处| 贫血吃什么最好| 什么危不什么| 夏令时什么时候开始和结束| 闭关修炼是什么意思| 梅毒滴度是什么意思| 汗多尿少是什么原因| 奠是什么意思| 检查糖尿病挂什么科| 阳强易举是什么意思| 缺陷的陷是什么意思| 合成立方氧化锆是什么| dv是什么牌子| 外阴白斑有什么症状| 秋葵有什么营养价值| 蛇怕什么家禽| 月亮星座是什么意思| 2004年出生属什么| 冰箱为什么结冰| 静脉曲张看什么科| 角化型脚气用什么药| 子宫内膜增厚是什么原因引起的| 中出是什么意思| yjs是什么意思| 肾阴虚是什么症状| 狗狗吐是什么原因| add是什么意思| 口食读什么| 检查甲亢挂什么科| 紫色搭配什么颜色| 中国的国花是什么花| 硬不起来吃什么好| 鬼门关是什么意思| 水分是什么意思| 室性早搏是什么意思| 来月经头晕是什么原因| 什么是甲醛| 1999年出生的属什么| 尿痛挂什么科| 女孩学什么专业好就业| 上岸了是什么意思| 息风止痉是什么意思| 产检挂什么科| 8月5日是什么星座| 红楼梦什么朝代| 加拿大现在是什么时间| fl是什么| 妈妈的妈妈叫什么| 吃什么对嗓子好| 男人分手是什么感觉| 有甲状腺结节不能吃什么| 8月10号是什么星座| 唐玄宗为什么叫唐明皇| 中暑不能吃什么| 封豕长蛇是什么意思| 一段奶粉和二段奶粉有什么区别| 扁平疣挂什么科| 前胸后背出汗多是什么原因| 尿蛋白是什么原因造成的| 618是什么星座| 包装饮用水是什么水| 异禀是什么意思| 腺肌症有什么症状| 食色性也什么意思| 两胸中间疼是什么原因| 命途多舛是什么意思| 桃花是什么颜色的| 草代表什么生肖| qy是什么意思| 138是什么意思啊| 生完孩子吃什么补身体| zqsg是什么意思| 81年属鸡的是什么命| 什么是对称轴| 呃逆吃什么药| 月经期适合吃什么水果| 124是什么意思| 什么是晶体| 蝴蝶是什么变的| 全身发麻是什么原因| 奕字五行属什么| 肺炎支原体阳性是什么意思| 小肚子疼挂什么科| 留级是什么意思| 阴阳两虚吃什么| 7月13号是什么星座| 什么情况下才做冠脉cta| 懿代表什么意思| 左侧卵巢囊性包块是什么意思| 白茶适合什么季节喝| 云是由什么组成的| 脚趾头麻木是什么原因引起的| 做三明治需要什么材料| 冰恋是什么| 什么叫统招生| 尿尿疼是什么原因| 北海为什么叫北海| gdp是什么意思| 疱疹用什么药最好| 好文采是什么意思| 斐乐是什么档次| 心脏是由什么组织构成的| 香港奶粉为什么限购| 什么人不能吃桃子| 白内障什么原因造成的| 甲状腺是挂什么科| 睾丸炎有什么症状| 迂回什么意思| 无花果什么时候结果| 肚脐右边按压疼是什么原因| 为什么会早产| 今年40岁属什么生肖| 泉肌症是什么病| 谁的尾巴有什么作用| 山竹什么人不能吃| 吃什么水果对眼睛好| 6月6号是什么日子| 十一月五号是什么星座| lee什么意思| 胃湿热吃什么药| 唇炎涂什么药膏| 杀鸡吓什么| 吃什么愈合伤口恢复最快| 压力大会有什么症状| 吃什么长头发快| 梦见在河里抓鱼是什么征兆| 甲状腺吃什么食物好| 什么去火| 雄激素过高是什么意思| 脂肪瘤挂什么科| 长绒棉是什么面料| 三月六日是什么星座| 送荷花的寓意是什么| 为什么会痛经| 黎山老母什么级别神仙| 一什么黑暗| 水球是什么| 全脂奶粉是什么意思| 什么是抗氧化| 春眠不觉晓的晓是什么意思| 碍事是什么意思| 同房子宫疼痛什么原因| 淋巴结肿吃什么消炎药| 梦见钓到大鱼是什么意思| 梦见水是什么征兆| 吃鱼对身体有什么好处| 什么节吃饺子| from是什么意思| 申是什么生肖| 濒危是什么意思| 奎字五行属什么| 去医院看脚挂什么科| 肚脐有分泌物还发臭是什么原因| 这是什么植物| 什么是白噪音| 发烧拉稀是什么原因| 平菇不能和什么一起吃| 周深为什么是女声| 男人梦到蛇预示着什么| 胃热吃什么食物好| 白癜风早期症状是什么| 什么行什么什么| 志字五行属什么| 背疽是什么病| 蜂蜜和什么食物相克| 感冒喝什么药| 经常嗓子疼是什么原因| 狮子座是什么象星座| 检查糖尿病挂什么科| 脚心热吃什么药| 利尿吃什么药| 佬是什么意思| 孝顺的真正含义是什么| 此什么非彼什么的意思| 厅堂是什么意思| 审美观是什么意思| 鼻毛变白是什么原因| 立刀旁与什么有关| 黄鼠狼最怕什么| 芙蓉花又叫什么花| 心电图异常q波什么意思| pr是什么| 站桩对身体有什么好处和功效| 瘦西湖为什么叫瘦西湖| 油光满面是什么意思| 灰白组织是什么意思| ip是什么意思| 低压高吃什么药最有效| 肛门指检是检查什么| 老人脚肿吃什么药消肿| 手指爆皮是什么原因| add是什么意思| bruce是什么意思| 洗劫一空是什么意思| 貌不惊人是什么意思| 搬迁送什么礼物好| rog是什么牌子| 左肺下叶钙化灶是什么意思| 上焦火吃什么药最有效| 头七需要做什么| 土和什么相生| 胎盘能吃吗有什么作用与功效| 新百伦鞋子什么档次| 什么脸型最好看| 史诗级什么意思| 火车头是什么意思| 卷腹是什么| 但愿人长久的下一句是什么| 软组织损伤用什么药| 深圳车牌摇号需要什么条件| 芡实适合什么人吃| 胎盘低置是什么原因造成的| 什么是传染性软疣| 篇幅是什么意思| 吃什么水果可以变白| opec是什么意思| 经期血量少是什么原因| 宅男是什么意思| 售馨是什么意思| 什么东西最吸引蛇| 无花果是什么季节的水果| 牙龈紫色是什么原因| 梦见很多蛇是什么意思| 上日下成念什么| 上焦火吃什么药最有效| 蛇的贵人是什么生肖| 什么是事实婚姻| 什么水是碱性水| 肽有什么作用| 马兰头是什么菜| hedgren是什么品牌| 细菌性痢疾吃什么药| 冰箱底部漏水是什么原因| 梦见蜈蚣是什么预兆| 俄罗斯的货币叫什么| 十月二十八是什么星座| 闹心是什么意思啊| 练八段锦有什么好处| 血糖高忌什么食物| 归宁是什么意思| 梦见煤气罐爆炸是什么意思| 糖尿病都有什么症状| 5月有什么节日| 妇科养荣胶囊主治什么| 为什么人死后要盖住脸| 手会发抖是什么原因| 清五行属什么| 百度Here naverokê

孕中期失眠是什么原因

Ji W?k?pediya, ens?klopediya azad.
Belgekirina modulê[n??an bide] [biguhêre] [d?rokê bib?ne] [rojane bike]
百度 我们有两栋房子,一栋冬天住,那里有鸡鸭鹅、几只山羊和2头牛,尽管不多,但足以维持全家所需。

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

Tracking categories

[?avkaniyê 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
腿抽筋吃什么药 掌勺是什么意思 pet是什么检查 蜂蜜什么时候喝比较好 手脚发麻是什么原因
枸杞和什么搭配壮阳 做胃镜有什么好处 手黄是什么原因 白雪什么什么 hhh是什么意思
血热吃什么药效果好 吃什么可以补气血 spv是什么 宁字五行属什么的 ih医学上是什么意思
喘息是什么意思 头出汗是什么原因 续航什么意思 冠状动脉ct检查什么 什么叫代孕
烫发对身体有什么危害hcv8jop4ns6r.cn alb是什么意思hcv8jop3ns4r.cn 人参适合什么人吃hcv7jop6ns0r.cn 化学性肝损伤是指什么cj623037.com 君子兰什么季节开花hcv8jop7ns6r.cn
荨麻疹忌口什么食物hcv8jop2ns2r.cn 经常打饱嗝是什么原因hcv9jop1ns6r.cn 淋巴结发炎挂什么科hcv8jop6ns1r.cn 法医是干什么的inbungee.com 为什么韩国叫棒子国beikeqingting.com
敬邀是什么意思jiuxinfghf.com 牙虫长什么样子hcv9jop6ns5r.cn 三凹征是什么hcv9jop0ns6r.cn 子宫肌瘤吃什么好hcv8jop0ns8r.cn 口腔医学是什么hcv9jop6ns4r.cn
聚精会神的看是什么词语hcv8jop8ns9r.cn 弦是什么hcv9jop1ns2r.cn 茄子炒什么好吃hcv8jop8ns8r.cn bug是什么意思hcv9jop0ns0r.cn 蚊子吸血是为了什么xscnpatent.com
百度