为什么单位不愿意申请工伤| 埋头苦干是什么生肖| 嗓子痛吃什么药好| 阴囊潮湿是什么原因造成的| 县尉相当于现在什么官| 喝酒前吃什么保护胃| 云的五行属性是什么| 什么的快乐| mm代表什么单位| 胃溃疡a1期是什么意思| 耳朵前面有痣代表什么| 地藏菩萨的坐骑是什么| 鹅蛋吃了有什么好处| 为什么吃肉多反而瘦了| 伤风是什么意思| rta是什么意思| 爆竹声中一岁除下一句是什么| 霸王花煲汤放什么材料| 水痘疫苗叫什么| o型血为什么招蚊子| 十二月份是什么星座| 腿脚发麻是什么原因| 眼皮跳是什么原因引起的| 强迫症什么意思| 切忌什么意思| 抑郁症挂什么科室| 路的尽头是什么| bea是什么意思| 不正常的人有什么表现| 佝偻病是什么| 脉浮是什么意思| 白细胞酯酶阳性是什么| 手麻脚麻是什么病| 1952年属什么生肖| 磷高有什么症状和危害| 什么叫tct检查| 呈味核苷酸二钠是什么| 话说多了声音嘶哑是什么原因| 八面玲珑代表什么生肖| 淋巴结肿大是什么原因引起的| 烂好人是什么意思| 月经期间适合吃什么| 肾炎有什么症状| 月经要来之前有什么症状| 什么叫通勤| 淋巴细胞减少说明什么| 什么叫佛| 支原体培养及药敏是检查什么| 上海市长什么级别| 嘴巴苦是什么原因引起的| 床头上面挂什么画好| 5个月宝宝吃什么辅食| 人中龙凤下一句是什么| 经常胃胀气是什么原因引起的| 多囊是什么症状| 左眼皮一直跳是什么预兆| 胃胀气是什么原因| est是什么意思| 梦见被狗咬是什么预兆| 做肝功能检查挂什么科| 什么叫中出| 高血压吃什么盐比较好| 孤枕难眠什么意思| 肝火郁结是什么症状| 什么天山| 黑枸杞对男性性功能有什么帮助| 早晨嘴苦是什么原因引起的| 糟老头是什么意思| 水星是什么颜色的| 普高和职高有什么区别| 土地出让金什么意思| 动土是什么意思| 母亲节买什么礼物| 红色的补色是什么颜色| who是什么组织| 肚子胀屁多是什么原因| 了加一笔是什么字| 日语一个一个是什么意思| 肠粉是用什么材料做的| 唐僧属什么生肖| 金骏眉茶是什么茶| 格斗和散打有什么区别| 什么是丘疹| 英特纳雄耐尔是什么意思| 深圳副市长什么级别| 叻叻猪是什么意思| 催丹香是什么意思| 国家主席是什么级别| 你想干什么| 三克油是什么意思| 吃什么升血压快| 摩羯座属于什么象星座| 什么叫辟谷减肥法| 8000年前是什么朝代| 后脑勺出汗是什么原因| 假卵是什么样子的| 什么是比| 为什么身上会长脂肪瘤| 胰岛素是什么器官分泌的| 2月12日什么星座| 骞读什么字| 坐东朝西是什么意思| 南昌有什么好玩的地方| 鸵鸟心态什么意思| 花是什么生肖| 什么是出轨| 科普一下是什么意思| 英纳格手表什么档次| scarves是什么意思| 胃窦炎是什么原因引起的| 长痔疮是什么引起的| 完谷不化吃什么中成药| 扑朔迷离是什么意思| 7月16日什么星座| 气虚用什么泡水喝好| 脚踩棉花感见于什么病| 什么东西放进去是硬的拿出来是软的| 2004年属什么| 为什么超市大米不生虫| 韩后属于什么档次| 河虾最爱吃什么食物| 锻炼pc肌有什么好处| 建议是什么意思| 农家一碗香是什么菜| 双花是什么中药| 机智如你是什么意思| 凉茶是什么茶| 经期吃什么排污血最强| BCG是什么意思| 甲亢吃什么食物好| 子宫内膜为什么会增厚| 为什么泡完脚后非常痒| 老年人助听器什么牌子好| 抗炎是什么意思| 糖代谢增高是什么意思| 产后漏尿是什么原因| 翘首企盼是什么意思| 慈禧和溥仪是什么关系| 吃烧烤后吃什么水果可以帮助排毒| 1215是什么星座| 榴莲皮可以做什么| 夫妻肺片有什么材料| 吃什么能增强性功能| 意下如何什么意思| 眼睛有点黄是什么原因| epl是什么意思| 小儿急性喉炎吃什么药| 乳腺增生吃什么食物好| 1950年属虎的是什么命| 喉软骨发育不良有什么症状| 双侧肾盂无分离是什么意思| 肠胃湿热吃什么药好| 什么是艾滋病| 深明大义是什么意思| 口腔溃疡是什么引起的| 幺蛾子是什么意思| 头晕恶心挂什么科| 知青是什么| 尿有泡泡是什么病| 寓言故事有什么特点| 水煎服是什么意思| sage是什么颜色| 农历11月25日是什么星座| 滔滔不绝的绝是什么意思| 梦见着大火了是什么征兆| 二个月不来月经是什么原因| 长寿面什么时候吃| 小孩吃什么通便降火| 齐白石擅长画什么| oa期刊是什么意思| 孕妇牙痛有什么办法| 皮疹是什么症状| outdoor是什么意思| 免疫组化检查是什么意思| 猪肚子和什么煲汤最好| 副高是什么意思| 强直性脊柱炎什么症状| 女朋友的弟弟叫什么| 过敏了吃什么药| navigare是什么牌子| 女人腰疼是什么妇科病| 鼎是干什么用的| 肝不好有什么症状表现| 鼻子干燥吃什么中成药| 咳嗽吃什么药好| 说辞是什么意思| 六味地黄丸什么时候吃最好| 尔时是什么意思| 但愿是什么意思| 梦见好多蚊子是什么意思| 高丽棒子是什么意思| 上不下要读什么| 小孩子打呼噜是什么原因| 姨妈期间吃什么水果| 肾功能四项检查什么| style是什么意思| 阿普唑仑片是什么药| 早上口干舌燥是什么原因| belle什么意思| k3是什么意思| 勤去掉力念什么| 中央电视台台长是什么级别| 反社会人格有什么表现| 指滑是什么意思| 夕阳是什么时候| 11月份是什么星座的| 私生饭什么意思| 1977年属蛇是什么命| 攸字五行属什么| 1994是什么年| 属什么生肖| nuxe是什么牌子护肤品| 腰痛是什么原因| 铄字五行属什么| 吃螃蟹不能喝什么饮料| 天目湖白茶属于什么茶| 夏季有什么蔬菜| 表达是什么意思| 出虚汗是什么原因引起的怎么调理| 直肠前突有什么症状| 脸发红发烫是什么原因| 什么是腕管综合征| 卡介苗为什么会留疤| 飞行模式有什么用| 榴莲什么时候吃最好| 吃什么养颜美容抗衰老| 双喜临门的临是什么意思| 指甲中间凹陷是什么原因| 什么药治肠炎效果最好| 惟妙惟肖是什么意思| s代表什么意思| 贫血做什么检查能查出来| 明哲保身是什么生肖| 小野猫是什么意思| 理财什么意思| tc版是什么意思| 婴儿放屁臭是什么原因| 鼻炎吃什么消炎药| 蓝色妖姬适合送什么人| 江苏属于什么方向| 胃痉挛吃什么药| 态度是什么意思| jk是什么| 阴液是什么| 奎宁是什么药| 高铁与动车有什么区别| 一桌餐是什么意思| 舌苔白是什么原因| 脑梗吃什么食物好| 什么是满汉全席| 1930年属什么| 老心慌是什么原因| 9月份是什么星座| 苍蝇馆子什么意思| 一月27日是什么星座| 下肢静脉血栓挂什么科| 男生为什么会晨勃| 高血压为什么不能献血| 肾阳虚吃什么| 苏联什么时候解体| vc是什么| 3月7日什么星座| 阴道b超检查什么| 脚底烧热是什么原因| 百度Jump to content

吃什么化痰

De Vicipedia
百度 意在致敬初心的杜鲁尔系列,系列名来自于天梭品牌诞生的街道,将品牌165年间厚重历史凝结在腕间一只满载精神力量的时计中。

Documentation for this module may be created at Modulo:Navbox/doc

require('strict')
local p = {}
local cfg = mw.loadData('Module:Navbox/configuration')
local inArray = require("Module:TableTools").inArray
local getArgs -- lazily initialized
local format = string.format

function p._navbox(args)
	local function striped(wikitext, border)
		-- Return wikitext with markers replaced for odd/even striping.
		-- Child (subgroup) navboxes are flagged with a category that is removed
		-- by parent navboxes. The result is that the category shows all pages
		-- where a child navbox is not contained in a parent navbox.
		local orphanCat = cfg.category.orphan
		if border == cfg.keyword.border_subgroup and args[cfg.arg.orphan] ~= cfg.keyword.orphan_yes then
			-- No change; striping occurs in outermost navbox.
			return wikitext .. orphanCat
		end
		local first, second = cfg.class.navbox_odd_part, cfg.class.navbox_even_part
		if args[cfg.arg.evenodd] then
			if args[cfg.arg.evenodd] == cfg.keyword.evenodd_swap then
				first, second = second, first
			else
				first = args[cfg.arg.evenodd]
				second = first
			end
		end
		local changer
		if first == second then
			changer = first
		else
			local index = 0
			changer = function (code)
				if code == '0' then
					-- Current occurrence is for a group before a nested table.
					-- Set it to first as a valid although pointless class.
					-- The next occurrence will be the first row after a title
					-- in a subgroup and will also be first.
					index = 0
					return first
				end
				index = index + 1
				return index % 2 == 1 and first or second
			end
		end
		local regex = orphanCat:gsub('([%[%]])', '%%%1')
		return (wikitext:gsub(regex, ''):gsub(cfg.marker.regex, changer)) -- () omits gsub count
	end
	
	local function processItem(item, nowrapitems)
		if item:sub(1, 2) == '{|' then
			-- Applying nowrap to lines in a table does not make sense.
			-- Add newlines to compensate for trim of x in |parm=x in a template.
			return '\n' .. item ..'\n'
		end
		if nowrapitems == cfg.keyword.nowrapitems_yes then
			local lines = {}
			for line in (item .. '\n'):gmatch('([^\n]*)\n') do
				local prefix, content = line:match('^([*:;#]+)%s*(.*)')
				if prefix and not content:match(cfg.pattern.nowrap) then
					line = format(cfg.nowrap_item, prefix, content)
				end
				table.insert(lines, line)
			end
			item = table.concat(lines, '\n')
		end
		if item:match('^[*:;#]') then
			return '\n' .. item ..'\n'
		end
		return item
	end
	
	local function has_navbar()
		return args[cfg.arg.navbar] ~= cfg.keyword.navbar_off
			and args[cfg.arg.navbar] ~= cfg.keyword.navbar_plain
			and (
				args[cfg.arg.name]
				or mw.getCurrentFrame():getParent():getTitle():gsub(cfg.pattern.sandbox, '')
					~= cfg.pattern.navbox
			)
	end
	
	-- extract text color from css, which is the only permitted inline CSS for the navbar
	local function extract_color(css_str)
		-- return nil because navbar takes its argument into mw.html which handles
		-- nil gracefully, removing the associated style attribute
		return mw.ustring.match(';' .. css_str .. ';', '.*;%s*([Cc][Oo][Ll][Oo][Rr]%s*:%s*.-)%s*;') or nil
	end
	
	local function renderNavBar(titleCell)
		if has_navbar() then
			local navbar = require('Module:Navbar')._navbar
			titleCell:wikitext(navbar{
				[cfg.navbar.name] = args[cfg.arg.name],
				[cfg.navbar.mini] = 1,
				[cfg.navbar.fontstyle] = extract_color(
					(args[cfg.arg.basestyle] or '') .. ';' .. (args[cfg.arg.titlestyle] or '')
				)
			})
		end
	
	end
	
	local function renderTitleRow(tbl)
		if not args[cfg.arg.title] then return end
	
		local titleRow = tbl:tag('tr')
	
		local titleCell = titleRow:tag('th'):attr('scope', 'col')
	
		local titleColspan = 2
		if args[cfg.arg.imageleft] then titleColspan = titleColspan + 1 end
		if args[cfg.arg.image] then titleColspan = titleColspan + 1 end
	
		titleCell
			:cssText(args[cfg.arg.basestyle])
			:cssText(args[cfg.arg.titlestyle])
			:addClass(cfg.class.navbox_title)
			:attr('colspan', titleColspan)
	
		renderNavBar(titleCell)
	
		titleCell
			:tag('div')
				-- id for aria-labelledby attribute
				:attr('id', mw.uri.anchorEncode(args[cfg.arg.title]))
				:addClass(args[cfg.arg.titleclass])
				:css('font-size', '114%')
				:css('margin', '0 4em')
				:wikitext(processItem(args[cfg.arg.title]))
	end
	
	local function getAboveBelowColspan()
		local ret = 2
		if args[cfg.arg.imageleft] then ret = ret + 1 end
		if args[cfg.arg.image] then ret = ret + 1 end
		return ret
	end
	
	local function renderAboveRow(tbl)
		if not args[cfg.arg.above] then return end
	
		tbl:tag('tr')
			:tag('td')
				:addClass(cfg.class.navbox_abovebelow)
				:addClass(args[cfg.arg.aboveclass])
				:cssText(args[cfg.arg.basestyle])
				:cssText(args[cfg.arg.abovestyle])
				:attr('colspan', getAboveBelowColspan())
				:tag('div')
					-- id for aria-labelledby attribute, if no title
					:attr('id', (not args[cfg.arg.title]) and mw.uri.anchorEncode(args[cfg.arg.above]) or nil)
					:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
	end
	
	local function renderBelowRow(tbl)
		if not args[cfg.arg.below] then return end
	
		tbl:tag('tr')
			:tag('td')
				:addClass(cfg.class.navbox_abovebelow)
				:addClass(args[cfg.arg.belowclass])
				:cssText(args[cfg.arg.basestyle])
				:cssText(args[cfg.arg.belowstyle])
				:attr('colspan', getAboveBelowColspan())
				:tag('div')
					:wikitext(processItem(args[cfg.arg.below], args[cfg.arg.nowrapitems]))
	end
	
	local function renderListRow(tbl, index, listnum, listnums_size)
		local row = tbl:tag('tr')
	
		if index == 1 and args[cfg.arg.imageleft] then
			row
				:tag('td')
					:addClass(cfg.class.noviewer)
					:addClass(cfg.class.navbox_image)
					:addClass(args[cfg.arg.imageclass])
					:css('width', '1px')               -- Minimize width
					:css('padding', '0 2px 0 0')
					:cssText(args[cfg.arg.imageleftstyle])
					:attr('rowspan', listnums_size)
					:tag('div')
						:wikitext(processItem(args[cfg.arg.imageleft]))
		end
	
		local group_and_num = format(cfg.arg.group_and_num, listnum)
		local groupstyle_and_num = format(cfg.arg.groupstyle_and_num, listnum)
		if args[group_and_num] then
			local groupCell = row:tag('th')
	
			-- id for aria-labelledby attribute, if lone group with no title or above
			if listnum == 1 and not (args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group2]) then
				groupCell
					:attr('id', mw.uri.anchorEncode(args[cfg.arg.group1]))
			end
	
			groupCell
				:attr('scope', 'row')
				:addClass(cfg.class.navbox_group)
				:addClass(args[cfg.arg.groupclass])
				:cssText(args[cfg.arg.basestyle])
				-- If groupwidth not specified, minimize width
				:css('width', args[cfg.arg.groupwidth] or '1%')
	
			groupCell
				:cssText(args[cfg.arg.groupstyle])
				:cssText(args[groupstyle_and_num])
				:wikitext(args[group_and_num])
		end
	
		local listCell = row:tag('td')
	
		if args[group_and_num] then
			listCell
				:addClass(cfg.class.navbox_list_with_group)
		else
			listCell:attr('colspan', 2)
		end
	
		if not args[cfg.arg.groupwidth] then
			listCell:css('width', '100%')
		end
	
		local rowstyle  -- usually nil so cssText(rowstyle) usually adds nothing
		if index % 2 == 1 then
			rowstyle = args[cfg.arg.oddstyle]
		else
			rowstyle = args[cfg.arg.evenstyle]
		end
	
		local list_and_num = format(cfg.arg.list_and_num, listnum)
		local listText = args[list_and_num]
		
		if inArray(cfg.keyword.subgroups, listText) then
			local childArgs = {
				[cfg.arg.border] = cfg.keyword.border_subgroup,
				[cfg.arg.navbar] = cfg.keyword.navbar_plain
			}
			local hasChildArgs = false
			for k, v in pairs(args) do
				k = tostring(k)
				for _, w in ipairs(cfg.keyword.subgroups) do
					w = w .. listnum .. "_"
					if (#k > #w) and (k:sub(1, #w) == w) then
						childArgs[k:sub(#w + 1)] = v
						hasChildArgs = true
					end
				end
			end
			listText = hasChildArgs and p._navbox(childArgs) or listText
		end
		
		local oddEven = cfg.marker.oddeven
		if listText:sub(1, 12) == '</div><table' then
			-- Assume list text is for a subgroup navbox so no automatic striping for this row.
			oddEven = listText:find(cfg.pattern.navbox_title) and cfg.marker.restart or cfg.class.navbox_odd_part
		end
		
		local liststyle_and_num = format(cfg.arg.liststyle_and_num, listnum)
		local listclass_and_num = format(cfg.arg.listclass_and_num, listnum)
		listCell
			:css('padding', '0')
			:cssText(args[cfg.arg.liststyle])
			:cssText(rowstyle)
			:cssText(args[liststyle_and_num])
			:addClass(cfg.class.navbox_list)
			:addClass(cfg.class.navbox_part .. oddEven)
			:addClass(args[cfg.arg.listclass])
			:addClass(args[listclass_and_num])
			:tag('div')
				:css('padding',
					(index == 1 and args[cfg.arg.list1padding]) or args[cfg.arg.listpadding] or '0 0.25em'
				)
				:wikitext(processItem(listText, args[cfg.arg.nowrapitems]))
	
		if index == 1 and args[cfg.arg.image] then
			row
				:tag('td')
					:addClass(cfg.class.noviewer)
					:addClass(cfg.class.navbox_image)
					:addClass(args[cfg.arg.imageclass])
					:css('width', '1px')               -- Minimize width
					:css('padding', '0 0 0 2px')
					:cssText(args[cfg.arg.imagestyle])
					:attr('rowspan', listnums_size)
					:tag('div')
						:wikitext(processItem(args[cfg.arg.image]))
		end
	end
	
	local function has_list_class(htmlclass)
		local patterns = {
			'^' .. htmlclass .. '$',
			'%s' .. htmlclass .. '$',
			'^' .. htmlclass .. '%s',
			'%s' .. htmlclass .. '%s'
		}
		
		for arg, _ in pairs(args) do
			if type(arg) == 'string' and mw.ustring.find(arg, cfg.pattern.class) then
				for _, pattern in ipairs(patterns) do
					if mw.ustring.find(args[arg] or '', pattern) then
						return true
					end
				end
			end
		end
		return false
	end
	
	-- there are a lot of list classes in the wild, so we add their TemplateStyles
	local function add_list_styles()
		local frame = mw.getCurrentFrame()
		local function add_list_templatestyles(htmlclass, templatestyles)
			if has_list_class(htmlclass) then
				return frame:extensionTag{
					name = 'templatestyles', args = { src = templatestyles }
				}
			else
				return ''
			end
		end
		
		local hlist_styles = add_list_templatestyles('hlist', cfg.hlist_templatestyles)
		local plainlist_styles = add_list_templatestyles('plainlist', cfg.plainlist_templatestyles)
		
		-- a second workaround for [[phab:T303378]]
		-- when that issue is fixed, we can actually use has_navbar not to emit the
		-- tag here if we want
		if has_navbar() and hlist_styles == '' then
			hlist_styles = frame:extensionTag{
				name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
			}
		end
		
		-- hlist -> plainlist is best-effort to preserve old Common.css ordering.
		-- this ordering is not a guarantee because most navboxes will emit only
		-- one of these classes [hlist_note]
		return hlist_styles .. plainlist_styles
	end
	
	local function needsHorizontalLists(border)
		if border == cfg.keyword.border_subgroup or args[cfg.arg.tracking] == cfg.keyword.tracking_no then
			return false
		end
		return not has_list_class(cfg.pattern.hlist) and not has_list_class(cfg.pattern.plainlist)
	end
	
	local function hasBackgroundColors()
		for _, key in ipairs({cfg.arg.titlestyle, cfg.arg.groupstyle,
			cfg.arg.basestyle, cfg.arg.abovestyle, cfg.arg.belowstyle}) do
			if tostring(args[key]):find('background', 1, true) then
				return true
			end
		end
		return false
	end
	
	local function hasBorders()
		for _, key in ipairs({cfg.arg.groupstyle, cfg.arg.basestyle,
			cfg.arg.abovestyle, cfg.arg.belowstyle}) do
			if tostring(args[key]):find('border', 1, true) then
				return true
			end
		end
		return false
	end
	
	local function isIllegible()
		local styleratio = require('Module:Color contrast')._styleratio
		for key, style in pairs(args) do
			if tostring(key):match(cfg.pattern.style) then
				if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
					return true
				end
			end
		end
		return false
	end
	
	local function getTrackingCategories(border)
		local cats = {}
		if needsHorizontalLists(border) then table.insert(cats, cfg.category.horizontal_lists) end
		if hasBackgroundColors() then table.insert(cats, cfg.category.background_colors) end
		if isIllegible() then table.insert(cats, cfg.category.illegible) end
		if hasBorders() then table.insert(cats, cfg.category.borders) end
		return cats
	end
	
	local function renderTrackingCategories(builder, border)
		local title = mw.title.getCurrentTitle()
		if title.namespace ~= 10 then return end -- not in template space
		local subpage = title.subpageText
		if subpage == cfg.keyword.subpage_doc or subpage == cfg.keyword.subpage_sandbox
			or subpage == cfg.keyword.subpage_testcases then return end
	
		for _, cat in ipairs(getTrackingCategories(border)) do
			builder:wikitext('[[Category:' .. cat .. ']]')
		end
	end
	
	local function renderMainTable(border, listnums)
		local tbl = mw.html.create('table')
			:addClass(cfg.class.nowraplinks)
			:addClass(args[cfg.arg.bodyclass])
	
		local state = args[cfg.arg.state]
		if args[cfg.arg.title] and state ~= cfg.keyword.state_plain and state ~= cfg.keyword.state_off then
			if state == cfg.keyword.state_collapsed then
				state = cfg.class.collapsed
			end
			tbl
				:addClass(cfg.class.collapsible)
				:addClass(state or cfg.class.autocollapse)
		end
	
		tbl:css('border-spacing', 0)
		if border == cfg.keyword.border_subgroup or border == cfg.keyword.border_none then
			tbl
				:addClass(cfg.class.navbox_subgroup)
				:cssText(args[cfg.arg.bodystyle])
				:cssText(args[cfg.arg.style])
		else  -- regular navbox - bodystyle and style will be applied to the wrapper table
			tbl
				:addClass(cfg.class.navbox_inner)
				:css('background', 'transparent')
				:css('color', 'inherit')
		end
		tbl:cssText(args[cfg.arg.innerstyle])
	
		renderTitleRow(tbl)
		renderAboveRow(tbl)
		local listnums_size = #listnums
		for i, listnum in ipairs(listnums) do
			renderListRow(tbl, i, listnum, listnums_size)
		end
		renderBelowRow(tbl)
	
		return tbl
	end
	
	local function add_navbox_styles(hiding_templatestyles)
		local frame = mw.getCurrentFrame()
		-- This is a lambda so that it doesn't need the frame as a parameter
		local function add_user_styles(templatestyles)
			if templatestyles and templatestyles ~= '' then
				return frame:extensionTag{
					name = 'templatestyles', args = { src = templatestyles }
				}
			end
			return ''
		end
	
		-- get templatestyles. load base from config so that Lua only needs to do
		-- the work once of parser tag expansion
		local base_templatestyles = cfg.templatestyles
		local templatestyles = add_user_styles(args[cfg.arg.templatestyles])
		local child_templatestyles = add_user_styles(args[cfg.arg.child_templatestyles])
	
		-- The 'navbox-styles' div exists to wrap the styles to work around T200206
		-- more elegantly. Instead of combinatorial rules, this ends up being linear
		-- number of CSS rules.
		return mw.html.create('div')
			:addClass(cfg.class.navbox_styles)
			:wikitext(
				add_list_styles() .. -- see [hlist_note] applied to 'before base_templatestyles'
				base_templatestyles ..
				templatestyles ..
				child_templatestyles ..
				table.concat(hiding_templatestyles)
			)
			:done()
	end
	
	-- work around [[phab:T303378]]
	-- for each arg: find all the templatestyles strip markers, insert them into a
	-- table. then remove all templatestyles markers from the arg
	local function move_hiding_templatestyles(args)
		local gfind = string.gfind
		local gsub = string.gsub
		local templatestyles_markers = {}
		local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
		for k, arg in pairs(args) do
			for marker in gfind(arg, strip_marker_pattern) do
				table.insert(templatestyles_markers, marker)
			end
			args[k] = gsub(arg, strip_marker_pattern, '')
		end
		return templatestyles_markers
	end
	
	local hiding_templatestyles = move_hiding_templatestyles(args)
	local listnums = {}
	
	for k, _ in pairs(args) do
		if type(k) == 'string' then
			local listnum = k:match(cfg.pattern.listnum)
			if listnum then table.insert(listnums, tonumber(listnum)) end
		end
	end
	table.sort(listnums)

	local border = mw.text.trim(args[cfg.arg.border] or args[1] or '')
	if border == cfg.keyword.border_child then
		border = cfg.keyword.border_subgroup
	end

	-- render the main body of the navbox
	local tbl = renderMainTable(border, listnums)

	local res = mw.html.create()
	-- render the appropriate wrapper for the navbox, based on the border param

	if border == cfg.keyword.border_none then
		res:node(add_navbox_styles(hiding_templatestyles))
		local nav = res:tag('div')
			:attr('role', 'navigation')
			:node(tbl)
		-- aria-labelledby title, otherwise above, otherwise lone group
		if args[cfg.arg.title] or args[cfg.arg.above] or (args[cfg.arg.group1]
			and not args[cfg.arg.group2]) then
			nav:attr(
				'aria-labelledby',
				mw.uri.anchorEncode(
					args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
				)
			)
		else
			nav:attr('aria-label', cfg.aria_label)
		end
	elseif border == cfg.keyword.border_subgroup then
		-- We assume that this navbox is being rendered in a list cell of a
		-- parent navbox, and is therefore inside a div with padding:0em 0.25em.
		-- We start with a </div> to avoid the padding being applied, and at the
		-- end add a <div> to balance out the parent's </div>
		res
			:wikitext('</div>')
			:node(tbl)
			:wikitext('<div>')
	else
		res:node(add_navbox_styles(hiding_templatestyles))
		local nav = res:tag('div')
			:attr('role', 'navigation')
			:addClass(cfg.class.navbox)
			:addClass(args[cfg.arg.navboxclass])
			:cssText(args[cfg.arg.bodystyle])
			:cssText(args[cfg.arg.style])
			:css('padding', '3px')
			:node(tbl)
		-- aria-labelledby title, otherwise above, otherwise lone group
		if args[cfg.arg.title] or args[cfg.arg.above]
			or (args[cfg.arg.group1] and not args[cfg.arg.group2]) then
			nav:attr(
				'aria-labelledby',
				mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1])
			)
		else
			nav:attr('aria-label', cfg.aria_label)
		end
	end

	if (args[cfg.arg.nocat] or cfg.keyword.nocat_false):lower() == cfg.keyword.nocat_false then
		renderTrackingCategories(res, border)
	end
	return striped(tostring(res), border)
end

function p.navbox(frame)
	local function readArgs(args, prefix)
		-- Read the arguments in the order they'll be output in, to make references
		-- number in the right order.
		local _
		_ = args[prefix .. cfg.arg.title]
		_ = args[prefix .. cfg.arg.above]
		-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
		-- iterator approach won't work here
		for i = 1, 20 do
			_ = args[prefix .. format(cfg.arg.group_and_num, i)]
			if inArray(cfg.keyword.subgroups, args[prefix .. format(cfg.arg.list_and_num, i)]) then
				for _, v in ipairs(cfg.keyword.subgroups) do
					readArgs(args, prefix .. v .. i .. "_")
				end
			end
		end
		_ = args[prefix .. cfg.arg.below]
	end

	if not getArgs then
		getArgs = require('Module:Arguments').getArgs
	end
	local args = getArgs(frame, {wrappers = {cfg.pattern.navbox}})
	readArgs(args, "")
	return p._navbox(args)
end

return p
熬夜吃什么补回来 什么叫子宫肌瘤 白介素6升高说明什么 霉菌阳性是什么意思 阴人是什么意思
百福图挂在家里什么位置好 什么样的脚好看 老流鼻血是什么原因引起的 什么的仪式 尿道口下裂是什么样子
倒立对身体有什么好处 脚心发热是什么原因 自理是什么意思 后背发热是什么原因 头颈出汗多是什么原因
小腹左边疼是什么原因 阴道清洁度三度什么意思 黑枸杞和红枸杞有什么区别 五月21号是什么星座 什么鱼是深海鱼
小熊猫长什么样hcv9jop7ns9r.cn 轻医美是什么hcv9jop0ns7r.cn mk是什么意思hcv7jop9ns9r.cn 胆囊炎挂什么科hcv8jop5ns6r.cn 典史是什么官hcv9jop0ns3r.cn
毛囊长什么样子hcv8jop2ns3r.cn 兔儿爷是什么意思hcv9jop1ns5r.cn 富甲一方什么意思hcv8jop3ns1r.cn hcg值低是什么原因hcv9jop4ns8r.cn 崇敬是什么意思hcv8jop5ns6r.cn
转卖是什么意思hcv9jop5ns0r.cn 如何查自己是什么命格hcv8jop3ns8r.cn 骨折挂什么科hcv8jop0ns3r.cn 树敌是什么意思hcv9jop5ns4r.cn 桑黄有什么功效hcv7jop6ns3r.cn
黄喉是什么东西hcv8jop7ns4r.cn 什么时候艾灸最好hcv9jop7ns1r.cn 妇科炎症吃什么食物好hcv9jop5ns6r.cn 矿油是什么wmyky.com 做梦梦见很多蛇是什么意思hcv9jop7ns5r.cn
百度