2022年属虎的是什么命| 虎的本命佛是什么佛| 不疼不痒的红疹是什么| 西洋参吃了有什么好处| 孤注一掷什么意思| 屈光检查是什么| 了加一笔是什么字| 属牛男最在乎女人什么| 恐龙吃什么| 卤水是什么成分| 孕早期吃什么水果好| 腔梗和脑梗有什么区别| 故宫什么时候闭馆| 墨镜什么牌子好| 辩证法是什么意思| 五常大米是什么意思| 什么喷剂延时最好| 做爱为什么那么舒服| 314是什么日子| 1996年出生属什么| 不是一路人是什么意思| 叶子是什么意思| 维生素e是什么| 人力资源是做什么的| 走后门什么意思| 沙棘原浆有什么功效| 什么时候用顿号| 中将是什么级别的干部| 梦见土豆是什么意思| 胎盘成熟度2级是什么意思| 它是什么结构| 牙杀完神经为什么还疼| 甲状腺适合吃什么食物| 非甾体抗炎药是什么意思| 什么叫囊肿| 感冒发烧吃什么饭菜好| 脑瘤到什么程度才会死| 旺夫脸是什么脸型| 氢氧化钙是什么东西| 酸梅汤不适合什么人喝| 鹦鹉吃什么水果| spoRT是什么| tct什么意思| 月经9天了还没干净是什么原因| 什么头十足| 双手麻木是什么原因| 吐槽是什么意思| 射精是什么感觉| 校正是什么意思| 回盲瓣呈唇形什么意思| 脑白质病变吃什么药| 啤酒对身体有什么好处| 卡其色裙子配什么颜色上衣好看| 四级残疾证有什么用| 二大爷是什么意思| 刚拔完智齿可以吃什么| 鼠肚鸡肠是什么生肖| 清热解毒是什么意思| 血浆是什么颜色| 马天宇是什么民族| 压到蛇了是有什么预兆| 相向而行什么意思| 浆细胞肿瘤是什么病| 孕早期头疼是什么原因| 凤尾鱼为什么突然就死| 肚脐上三指是什么地方| 心机血缺血是什么症状| 超市属于什么行业| 梦见蛇吃人代表什么预兆| 胸腔疼痛挂什么科| 什么样的大地| 外科和内科有什么区别| 吃什么最容易减肥| 玻璃人是什么意思| 市公安局长什么级别| 大海里面有什么| 甲状腺病变是什么意思| 嘴干嘴苦是什么原因| 手机什么时候发明的| 山竹为什么叫山竹| 头痛吃什么药最好| 空降是什么意思| 开塞露是干什么用的| 元五行属什么| 痤疮涂什么药膏| 不什么不| 黑胡椒和白胡椒有什么区别| 暗合是什么意思| loreal是什么品牌| 困是什么原因| 三七粉适合什么人群喝| 苁蓉有什么功效| 老舍的原名是什么| 传导阻滞是什么意思| 女性性高潮是什么感觉| 梦到别人怀孕了是什么意思| negative是什么意思| 这次台风叫什么| 三什么五什么| 反乌托邦什么意思| 产后第一天吃什么最好| 感染hpv有什么症状| 至多是什么意思| 打蛋白针有什么作用| 香草是什么| 什么属于包皮过长| cj是什么意思| 头皮发麻是什么原因| 直爽是什么意思| lad是什么意思| 心衰用什么药| 煲排骨汤放什么材料好| oc是什么| 波子是什么车| 生理期是什么意思| 瓜子脸剪什么发型好看| 穿拖鞋脚臭是什么原因| 川崎病是什么病| 心肌酶高有什么症状| 泌乳素高是什么意思| 姨妈期可以做什么运动| 生吃黄瓜有什么好处| 胃痉挛吃什么药| 倭瓜是什么瓜| 脑梗怎么形成的原因是什么| 劝退是什么意思| 什么山色| 什么叫辅酶q10| 孕妇dha什么时候吃| 结节灶是什么意思啊| 康复是什么意思| 广州属于什么气候| 鼻烟壶是干什么用的| 预科班什么意思| 大肠杆菌是什么意思| 三七粉主要治疗什么病| 文理分科什么时候开始| 氮泵有什么作用| honor是什么牌子手机| 青春永驻是什么意思| pt是什么时间| 嗓子中间的那块小肉叫什么| 促甲状腺激素低是什么原因| 空五行属什么| tablet是什么意思| 阴道痒用什么药| 什么水果通便| 毛毛虫吃什么食物| 胎膜早破是什么意思| 三鹿奶粉现在叫什么| mac是什么意思啊| 山洪是什么意思| 禁欲有什么好处| 喝什么对肾好| 来月经有异味什么原因| 际遇是什么意思| 死鱼眼是什么样子的| hiv1是什么意思| 视什么如什么| 赵构为什么杀岳飞| oc是什么意思| 平常平时叫什么日| 纹眉需要注意什么| 吐纳是什么意思| 长期腹泻是什么病| 什么叫空调病| 什么都别说| 伤官配印是什么意思| 猪血不能和什么一起吃| 贤良淑德后半句是什么| 肠胃不好吃什么菜比较好| 上焦有火吃什么中成药| 加息是什么意思| 京豆有什么用| 罪恶感什么意思| 马来玉是什么玉| 心慌是什么症状| 右边腰疼是什么原因| 病毒是什么| 牙痛吃什么药效果最好| 宫内孕和宫外孕有什么区别| 儿童查微量元素挂什么科| 什么动物没尾巴| 有什么好吃的外卖| pickup是什么意思| rarone是什么牌子的手表| 七八年属什么生肖| 什么的意思| 子宫内膜薄吃什么药| 送礼送什么水果| 姜太公钓鱼愿者上钩是什么意思| 诗眼是什么意思| 什么是收缩压和舒张压| 什么是双高| 冰妹是什么| 眼睛充血什么原因| 风疹是什么样子图片| 朵字五行属什么| 糖化血糖是什么意思| 6月初三是什么日子| 金字是什么部首| 什么样的梦想| 经期吃什么缓解痛经| 年字五行属什么| 五行是指什么| 驾驶证照片是什么底色| 什么海里没有鱼| 脂膜炎是什么病严重吗| 文房四宝是指什么| 口腔溃疡是什么样子| 小孩满月送什么礼物好| 心脏长在什么位置| 维生素c补什么| 碳水化合物指的是什么食物| 宝宝便秘吃什么| 红酒配什么菜| avia是什么牌子| 委曲求全是什么生肖| 什么人容易得梦游症| 西游记告诉我们什么道理| 例假推迟是什么原因引起的| 开心的反义词是什么| 焗油和染发有什么区别| 七月22号是什么星座| 决明子泡水喝有什么功效| 刮痧的痧是什么东西| 夏天有什么花| 故步自封是什么意思| 腺肌瘤是什么病| 夏天喝什么解渴| 矗读什么| 运动出汗多是什么原因| sub是什么意思| 11月份什么星座| 扁平足是什么意思| 中国属于什么气候| 玻璃体混浊吃什么药好| 为什么会眼压高| 脊柱侧弯拍什么片子| 肾结石要忌口什么东西| 茜字五行属什么| 龙眼是什么季节的水果| 孕早期吃什么| 睡美人最怕得什么病| 一六年属什么生肖| 脖子上长痘痘是什么原因| 西米是什么做成的| 下旬是什么意思| 手上有红点是什么原因| 咳嗽痰多吃什么药| 衣原体感染吃什么药| 脉冲什么意思| 亚麻跌是什么意思| 夏天可以种什么蔬菜| 总是耳鸣是什么原因| 细胞由什么组成| 汉语拼音什么时候发明的| 一个家庭最重要的是什么| 什么是比特币| 唯我独尊是什么意思| 胎动什么感觉| 抗日战争什么时候开始的| 蓝色的小药丸是什么药| 摩根石是什么| 百度??? ?? ?????

厦门:潜伏一夜徒手生擒盗贼 "90后"军人见

?????? ?? ??? ???? ????????? ???
?? ?????????? ????????? ????
??????? ??????[?????] [??????] [???????] [???????]
百度 6、橄榄橄榄性温,有生津清肺、利咽消肿、解毒的作用,对风热感冒合并咽喉肿痛者尤为适宜。

??????:Infobox ?? ??? ??? ?? ???????? {{Infobox}} ?? ???? ??????. ???????? ??? ???? ????? ?????? ??????? ?? ????? ?? ???? ??? ???? ?????? ????.

??????? ??????

local p = {}
local args = {}
local origArgs = {}
local root
local yesno = require('Module:Yesno')
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[?][?][?]%s*:[^]]*]]'
local has_rows = false
local lists = {
	plainlist_t = {
		patterns = {
			'^plainlist$',
			'%splainlist$',
			'^plainlist%s',
			'%splainlist%s'
		},
		found = false,
		styles = '????? ????/styles.css'
	},
	hlist_t = {
		patterns = {
			'^hlist$',
			'%shlist$',
			'^hlist%s',
			'%shlist%s'
		},
		found = false,
		styles = 'Hlist/styles.css'
	}
}

local function has_list_class(args_to_check)
	for _, list in pairs(lists) do
		if not list.found then
			for _, arg in pairs(args_to_check) do
				for _, pattern in ipairs(list.patterns) do
					if mw.ustring.find(arg or '', pattern) then
						list.found = true
						break
					end
				end
				if list.found then break end
			end
		end
	end
end

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*[?][?][?]%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 mw.ustring.match(s, 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 = mw.ustring.match(tostring(k), '^' .. 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(
				'[[???:????????? ?? ?? ??????? ???? ??????? ?? ???????? ???? ?????? ????????? ??????? ???????]]'
			)
		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
		has_list_class({ imageArgs.rowclass, imageArgs.class })
		
		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 yesno(italicTitle) == 'yes' or italicTitle == '??????' 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(
				'[[???:????????? ?? ?? ??????? ???? ??????? ?????????? ?? ??????? ????? ??????? ???????]]'
			)
		end
	elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
		root:wikitext('[[???:?????????? ?? ?? ??????? ???? ??????? ???? ???????? ???? ??????? ???????]]')
	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("????? ??? ????? ???? ???? ?????? ??????? ??", 2)
	end
	if type(step) ~= 'number' then
		error("????? ??????? ???? ????? ??????? ??", 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('????? ??????? ???? ???? ?????? preprocessArgs ??????? ??', 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('????? ??????? ???? ??????? ?depend? ?? ???? 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
七月十六是什么日子 两个虎是什么字 飞行模式是什么意思 宝宝睡觉突然大哭是什么原因 腹泻拉水是什么原因
蜜蜂为什么要采蜜 醋是什么颜色 补肝血吃什么药 老年人吃什么好 医保是什么
骆驼奶有什么功效 多吃海带有什么好处和坏处 女性虚火旺吃什么下火 盆腔炎是什么症状 免冠是什么意思
七月十号是什么日子 什么是结膜炎 胆固醇高应注意什么 寒衣节是什么意思 2002年五行属什么命
男性粘液丝高什么原因hcv8jop1ns5r.cn 洗衣机不排水是什么原因0735v.com 石斛是什么hcv8jop7ns2r.cn 淀粉样变是什么病hcv9jop3ns8r.cn 海啸是什么意思hcv8jop6ns9r.cn
婴儿血小板低是什么原因hcv8jop5ns7r.cn 孩子总爱哭是什么原因hcv8jop0ns4r.cn 震颤是什么症状chuanglingweilai.com 眼眶发青是什么原因hcv7jop6ns2r.cn 养胃早餐吃什么好hcv7jop9ns3r.cn
入睡难是什么原因hcv8jop7ns4r.cn 口中发甜是什么原因hcv8jop1ns2r.cn LOP是什么胎位hcv8jop8ns5r.cn 科举制什么时候废除hcv9jop4ns7r.cn 鸦片鱼是什么鱼0297y7.com
看眼睛挂什么科hcv7jop5ns3r.cn 女人补肾吃什么药hcv8jop1ns3r.cn 怀孕第一个月最怕什么wzqsfys.com 小腹痛男性什么原因hcv8jop3ns5r.cn 甲状腺炎有什么症状表现hcv9jop2ns6r.cn
百度