<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.wikiw.cn/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Admin</id>
	<title>维基百科 - 用户贡献 [zh-cn]</title>
	<link rel="self" type="application/atom+xml" href="https://www.wikiw.cn/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Admin"/>
	<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E7%89%B9%E6%AE%8A:%E7%94%A8%E6%88%B7%E8%B4%A1%E7%8C%AE/Admin"/>
	<updated>2026-04-08T11:58:06Z</updated>
	<subtitle>用户贡献</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E4%BB%BB%E6%AD%A3%E9%9D%9E&amp;diff=2223</id>
		<title>任正非</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E4%BB%BB%E6%AD%A3%E9%9D%9E&amp;diff=2223"/>
		<updated>2025-09-28T18:00:56Z</updated>

		<summary type="html">&lt;p&gt;Admin：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;任正非&#039;&#039;&#039;（{{bd|1944年|10月25日|||catIdx=Ren任}}），男，汉族，祖籍[[浙江省]][[浦江县]]黄宅镇任店村，出生于[[贵州省]][[镇宁县]]&amp;lt;ref&amp;gt;{{Cite web |title=任正非：华为这么成功，与我不自私有一点关系 |url=https://wenhui.whb.cn/third/baidu/201905/22/264803.html |website=文汇报 |access-date=2024-12-04 |archive-date=2025-02-17 |archive-url=https://web.archive.org/web/20250217092124/https://wenhui.whb.cn/third/baidu/201905/22/264803.html |dead-url=no }}&amp;lt;/ref&amp;gt;，中国企业家。1963年，任正非进入[[重庆建筑工程学院]]学习。毕业后入伍成为基建工程兵，至1982年退伍，转业至深圳工作。1987年，他创立[[华为公司]]并担任行政總裁与董事至今。&amp;lt;ref&amp;gt;{{Cite web |title=任正非的忧患与危机：艰难创业 曾从噩梦中醒来哭泣 |url=https://finance.sina.cn/2018-02-06/detail-ifyreuzn3610439.d.html?from=wap |website=finance.sina.cn |date=2018-02-06 |last=sina_mobile |access-date=2024-12-04 |archive-date=2025-02-18 |archive-url=https://web.archive.org/web/20250218235522/https://finance.sina.cn/2018-02-06/detail-ifyreuzn3610439.d.html?from=wap |dead-url=no }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 生平 ==&lt;br /&gt;
===家庭背景===&lt;br /&gt;
任正非祖籍[[浙江省|浙江]][[浦江县|浦江]]黄宅镇任店村。{{sfn|李洪文|2019|p=2}}{{sfn|余胜海|2017|p=72}}任正非的爷爷任三和是腌制[[金华火腿]]的师傅。{{sfn|李洪文|2019|p=3}}任正非的父亲任木生，字摩逊，名字的含义是“不逊于人”，曾在[[北平市]]北平民大经济系读大学，是任店村第一个大学生。{{sfn|李洪文|2019|p=3}}任木生在校期间加入了[[中国共产主义青年团]]，參加過[[抗日救亡运动]]。{{sfn|李洪文|2019|p=3}}任三和去世后，家里失去经济来源，任木生辍学在家，先后在浙江定海水产职业学校、南京农业职业中学等中学执教。{{sfn|李洪文|2019|p=3}}&lt;br /&gt;
&lt;br /&gt;
1937年12月，[[日本陆军]]占领[[中華民國]]首都[[南京市]]，任木生在浙江同乡的介绍下，来到[[國民政府]]412军工厂任会计师，这家工厂专门生产[[防毒面具]]。{{sfn|李洪文|2019|p=3}}任木生经常在工厂里主張抗日，引起了[[中國國民黨]][[特務]]的注意。{{sfn|李洪文|2019|p=3}}由于大日本帝国陆军步步紧逼，412军工厂经[[廣西省 (中華民國)|广西省]]辗转迁到贵州省[[桐梓县]]。{{sfn|李洪文|2019|p=4}}1944年，任木生觉得形势不好，以送家眷回乡定居为由，悄悄地离开了工厂，中国国民党特务却误抓了他人。{{sfn|李洪文|2019|p=4}}次日，任木生装病，请村里人用皮龙（类似轿子）将自己抬到郑家坞火车站，摆脱了中国国民党[[特务]]的抓捕，最后来到贵州省镇宁县的山区生活。{{sfn|李洪文|2019|p=4}}&lt;br /&gt;
&lt;br /&gt;
任木生在这里认识了17岁的程远昭并且结婚。{{sfn|李洪文|2019|p=4}}程远昭高中毕业，自学成为一名数学老师。{{sfn|李洪文|2019|p=5}}{{sfn|余胜海|2017|p=72}}两人结婚后育有二子五女。{{sfn|李洪文|2019|p=5}}1958年，任木生加入[[中国共产党]]。{{sfn|李洪文|2019|p=5}}任木生曾在都匀一中当了三年校长。[[文化大革命]]时期，红卫兵因他曾在国民政府兵工厂上班来抄家，结果发现家徒四壁，被单下面都是稻草。{{sfn|李洪文|2019|p=5}}&lt;br /&gt;
&lt;br /&gt;
===早年生涯===&lt;br /&gt;
1944年10月25日，任正非出生在[[貴州省 (中華民國)|贵州省]][[镇宁布依族苗族自治县|镇宁县]]（今[[镇宁布依族苗族自治县]]），祖籍[[浙江省|浙江]][[浦江县|浦江]]黄宅镇任店村。{{sfn|李洪文|2019|p=2}}{{sfn|余胜海|2017|p=72}}小时候，任正非每天和小伙伴准时收听[[评书]]《[[隋唐演义]]》。{{sfn|李洪文|2019|p=6}}小学和初中在家里附近的山村学校度过。{{sfn|李洪文|2019|p=6}}&lt;br /&gt;
&lt;br /&gt;
[[大跃进]]开始后，全国各地盲目虚报产量，导致高征购任务完成后，公共食堂只剩下一点点粮食给老百姓。{{sfn|李洪文|2019|p=9}}1960年，贵州省出现严重的饥荒现象，但是[[贵州行政长官列表|贵州省省长]]兼[[中国共产党贵州省委员会|书记]]的[[周林]]还是向[[中国共产党中央委员会|中共中央]]报告贵州省大办食堂的“先进经验”，中央评选贵州省为“红旗省”。{{sfn|李洪文|2019|p=9}}为了养活一家人，任正非家中实行严格的分餐制，分餐制的好处是虽然每个人都吃不饱，但是每个人都能活下去。{{sfn|李洪文|2019|p=10}}为了战胜饥饿，任正非家经常去山里采摘红刺果、[[蕨菜|蕨菜根]]、[[栎属|青杠子]]，磨成粉，代替粮食。{{sfn|李洪文|2019|p=10}}{{sfn|余胜海|2017|p=73}}同时在山上开辟了一块荒地，种了[[南瓜]]，在播种南瓜时，他们发现[[美人蕉]]的根可以煮熟吃。{{sfn|李洪文|2019|p=10}}高中三年，由于贫穷，任正非没有穿过衬衫，一直都是一件厚厚的单衣。{{sfn|李洪文|2019|p=11}}高三时期，任正非在家复习，他的书桌前的瓦罐里装着全家人的口粮，即使再饥饿，他也没有抓里面的口粮吃，否则“会有一两个弟妹活不到今天”。{{sfn|李洪文|2019|p=11}}{{sfn|余胜海|2017|p=73}}为了解决饥饿，任正非把[[米糠]]和菜掺和在一起吃，由于对身体不好，被父亲发现后制止。{{sfn|李洪文|2019|p=11}}{{sfn|余胜海|2017|p=73}}临近高考，即便生活穷苦，程远昭每天早上还是给他一个[[玉米|玉米饼]]。后来任正非追忆这段心酸往事说：&amp;lt;blockquote&amp;gt;每天早上一小块玉米饼，功劳巨大。如果不是这样，也许我就办不了华为这样的公司，只是社会上多了一名养猪能手，或街边多了一名能工巧匠而已。这个小小的玉米饼，是从父母和弟妹的口中抠出来的，我对他们无以报答……{{sfn|李洪文|2019|p=12}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
1963年，19岁的任正非考上[[重庆建筑工程学院]]（后并入[[重庆大学]]）暖通专业。{{sfn|李洪文|2019|p=12}}{{sfn|余胜海|2017|p=73}}程远昭给他做了两件白衬衣和一床拼对的被单，这三样陪伴他度过了大学四年。{{sfn|李洪文|2019|p=12}}{{sfn|余胜海|2017|p=73}}1966年，[[毛泽东]]发起[[文化大革命]]，在大学读书的任正非收到家中的一封信，提到他父亲因在412军工厂工作经历被造反派打倒，接受批判。{{sfn|李洪文|2019|p=16}}{{sfn|余胜海|2017|p=73}}任正非登上一列火车，火车上挤满了手持《[[毛泽东语录]]》的[[红卫兵]]，他们对着乘客大喊“战斗”口号，盘问乘客是“什么成分”，任正非因回答父亲是教师被推下了火车，他只好步行回到了家。{{sfn|李洪文|2019|p=17}}{{sfn|余胜海|2017|p=73}}任正非告诉家人，大学里也在“搞斗争”，基本上没有人上课了，但是父亲告诉他，“知识就是力量，别人不学，你要学，不要随大流，以后有能力要帮助弟妹。”{{sfn|李洪文|2019|p=18}}{{sfn|余胜海|2017|p=73}}父亲还脱下自己的一双旧皮鞋给他穿。{{sfn|余胜海|2017|p=73}}由于父亲的历史问题，任正非的6个弟妹连小学、初中、高中都没有读完，便在河里挖沙子、修铁路、抬土方。{{sfn|李洪文|2019|p=18}}任木生被打倒后，红卫兵要他放下教鞭去做苦工。{{sfn|李洪文|2019|p=18}}&lt;br /&gt;
&lt;br /&gt;
回到大学后，任正非自学了电子计算机、数字技术、自动控制、逻辑、哲学、英语和日语等三门外语。{{sfn|李洪文|2019|p=19}}任木生每天关在[[牛棚]]挂着牌子接受[[批斗]]，任正非知道父亲处境艰难，就收集了许多传单，寄给母亲，其中有一张传单上有[[周恩来]]的一段话：“干部要实事求是，不是的不要乱承认，事情总会搞清的”，程远昭把这段话藏在饭碗里，给任木生，后来任木生说是这张条子救了他的命，他才没有自杀，因为自杀等于自绝于人民，让子女一辈子背上政治包袱。{{sfn|李洪文|2019|p=20}}1970年按当时政策所有大学生离校进入部队当兵锻炼。{{sfn|李洪文|2019|p=20}}&lt;br /&gt;
&lt;br /&gt;
===职业生涯===&lt;br /&gt;
任正非调到[[安顺地区]]的[[基建工程兵]]第31支队第304大队，参与011基地飞机工厂的工程建设。{{sfn|李洪文|2019|p=21}}1970年，该厂制造的第一架飞机试飞成功。{{sfn|李洪文|2019|p=21}}1974年，为建设工业现代化，中国政府利用中美关系解冻后与西方国家大建交的有利局势，从西方国家及苏联利用石油美元实施了“[[四三方案]]”，大量引进具有当时世界先进水平的大化肥、大化纤及一米七连轧机、燃煤机组等成套设备。其中从[[法国]]德布尼斯·斯贝西姆公司引进一套世界先进的[[化纤]]项目，总投资28亿元，在[[辽阳]]建立辽阳石油化纤总厂，为了保证项目顺利，中国政府从全国调集优秀人才参加这个工程。{{sfn|李洪文|2019|p=20}}&lt;br /&gt;
&lt;br /&gt;
同年，任正非应征入伍，加入了承担这项工程建设任务的中国人民解放军[[基建工程兵]]第22支队，历任技术员、工程师，从事化工自动控制。{{sfn|李洪文|2019|p=20}}{{sfn|余胜海|2017|p=74}}辽阳石化1974年8月动工兴建，1979年基本建成并转入试生产。因发明空气压力天平获得1977年全军技术成果一等奖，荣立二等功，晋升为副所长（技术副团职）。1977年10月14日《文汇报》第四版以“我国第一台空气压力天平”为题报道全文如下：&amp;lt;ref&amp;gt;{{Cite web |url=https://www.sohu.com/a/318194337_796789 |title=“我国第一台空气压力天平”，《文汇报》1977年10月14日第四版 |access-date=2021年4月18日 |archive-date=2021年4月18日 |archive-url=https://web.archive.org/web/20210418132643/https://www.sohu.com/a/318194337_796789 |dead-url=no }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
解放军基建工程兵某部青年技术员任正非在仪表班战士的配合下，研制成功我国第一台高精度计量杯准仪器--空气压力天平，为我国仪表工业填补了一项空白。经国家有关计量部门鉴定，仪器设计方案正确，精度、灵敏度好。空气压力天平是一种用来检验高精度仪表的仪器。过去我国的仪表工厂、仪表使用单位和检验部门检验仪表压力、流量、液面等，使用的是标准双管活塞压力计和充水、充汞单管压力计。空气压力天平与双管活塞压力计和充水、充汞压力计相比，不但精度高，而且体积小，重量轻，用途广泛，操作方便，而且对于消除汞害、改善工作条件也有很大的好处。这种仪表是最近几年刚出现的，目前世界上只有几个工业发达的国家能制造。&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
1977年10月8日至11月5日[[基建工程兵]]在北京举行工作会议。到会的有一千多名领导干部和先进典型，10月24日华国锋、叶剑英、邓小平、李先念、汪东兴等党和国家领导人接见了参加会议的全体代表。本次大会表彰了一批工程技术人员。他们是曾被誉为“吊装大王”、在建设“辽化”中又创造新成绩的工程师张士刚；兴建[[毛主席纪念堂]]先进标兵、工程师程祖明；研制成功空气压力天平的青年技术员任正非；试制成功电子光子比色计等新型仪器的技术员李万山；创造胶体电瓶新工艺的某部修理二中队代表赵宽林等。1978年3月，33岁的任正非到[[北京市]]出席了6000多名代表参加的[[全国科学大会]]，这些人中，仅有150余人年龄在35岁以下。{{sfn|李洪文|2019|p=22}}{{sfn|余胜海|2017|p=74}}同年，任正非加入[[中国共产党]]。&amp;lt;ref&amp;gt;{{cite web|url=https://www.bbc.com/zhongwen/simp/chinese-news-46889202|access-date=2019-01-17|title=华为任正非谈孟晚舟案：想女儿、无“后门”、特朗普“伟大”|newspaper=BBC中文网|date=2019-01-16|archive-url=https://web.archive.org/web/20190117033415/https://www.bbc.com/zhongwen/simp/chinese-news-46889202|archive-date=2019-01-17|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
化纤总厂建好后，中国已经开始实行[[改革开放]]，此时，中国人认为棉布比化纤好，化纤不透气，而且一旦着火就会粘在身上烧，化纤总厂改做包装袋了。{{sfn|李洪文|2019|p=21}}在工作之余，任正非读了[[卡尔·马克思|马克思]]的《[[资本论]]》、四卷本《[[毛泽东选集]]》。{{sfn|李洪文|2019|p=22}}&lt;br /&gt;
&lt;br /&gt;
1982年，中国政府调整国民经济、国家体制、军队体制，实施[[百万大裁军|裁减军队]]，决定撤销中国人民解放军基本建设工程兵部队。{{sfn|李洪文|2019|p=22}}由于任正非是技术骨干，领导准备将他转往一个科研基地，当他们参观了科研基地的环境，看到四面群山，要和家人分离，思前想后，决定转业。{{sfn|李洪文|2019|p=23}}此时，任正非的妻子已经先他一步在深圳市[[南油集團|南油集团]]工作。随后，他办理完转业手续，结束11年的部队生活，带着一双儿女南下深圳市。{{sfn|李洪文|2019|p=23}}{{sfn|余胜海|2017|p=75}}同年，他出席了[[中国共产党第十九次全国代表大会代表名单|中共第十二次全国代表大会]]。{{sfn|李洪文|2019|p=22}}{{sfn|余胜海|2017|p=74}}加入南油集团之后，任正非看不惯一些部门领导得过且过、不思进取的官僚作风，请求将公司旗下的一个小公司交给他管理，但是没有得到批准，1983年被任命为该集团旗下一家电子公司的副总经理。{{sfn|李洪文|2019|p=23}}不久之后，任正非被一名商人欺骗，骗走了200多万元的一笔巨额贷款，当时内地一个月工资都不到100元，任正非转业的第一份工作以辞职告终。{{sfn|李洪文|2019|p=23}}{{sfn|余胜海|2017|p=75}}辞职后，任正非和妻子离了婚，他和父母、侄子租了一间十几平方米的房子住在一起。{{sfn|李洪文|2019|p=23}}{{sfn|余胜海|2017|p=75}}&lt;br /&gt;
&lt;br /&gt;
===创立华为===&lt;br /&gt;
{{main|华为}}&lt;br /&gt;
1987年，43岁的任正非和合伙人一起集资2.1万元人民币创立“[[华为|深圳华为技术有限公司]]”，取名的含义是“心系中华，有所作为”。{{sfn|李洪文|2019|p=26}}{{sfn|余胜海|2017|p=75}}任正非的公司租在居民楼，一个月最多三四百元的房租，而当时写字楼一个月好几千元房租。{{sfn|李洪文|2019|p=27}}&lt;br /&gt;
&lt;br /&gt;
公司建立之初，任正非一直思考做什么赚钱，朋友推荐他做墓碑，当时一块墓碑的石料成本七八十元，刻上字卖四五百元，雕琢精细的可以卖上千元，任正非认为墓碑不是长久之计便放弃了。{{sfn|李洪文|2019|p=27}}经过朋友介绍，他开始代销火灾警报器、气浮仪等厂矿所需的工业仪器，但是由于订货量少，不足以维持公司的正常运转。{{sfn|李洪文|2019|p=27}}&lt;br /&gt;
&lt;br /&gt;
后来，他看中了香港鸿年公司的小型{{lang|en|HAX}}程控交换机。{{sfn|李洪文|2019|p=27}}任正非通过代销{{lang|en|HAX}}[[程控交换机]]，为公司赚了第一桶金。{{sfn|李洪文|2019|p=28}}由于代销门槛低，需求资金少，一时间很多小公司蜂拥而上，出现不少一样的代销公司和华为抢生意，导致交换机供不应求，供不上货。{{sfn|李洪文|2019|p=28}}&lt;br /&gt;
&lt;br /&gt;
面对交换机价格逐步下降，任正非做了一个决定，自己进口组件，在深圳湾一个简易仓库里，雇佣工人，自己组装小型用户交换机。{{sfn|李洪文|2019|p=28}}仓库的一头用砖头砌了一堵墙，组成单间，就是工人的生活之所。{{sfn|李洪文|2019|p=28}}当时中国市场上是“七国八制”的局面，日本{{lang|en|NEC}}和富士通、美国朗讯、加拿大北电、瑞典爱立信、德国西门子、比利时贝尔、法国阿尔卡特。{{sfn|李洪文|2019|p=33}}任正非决定华为生产自己的程控交换机。{{sfn|李洪文|2019|p=33}}1988年任华为公司总裁至今。&amp;lt;ref&amp;gt;{{cite web|url=http://finance.ifeng.com/business/renwu/20130206/7650057.shtml|title=任正非被称大方的小气鬼 曾率员工在总统套房打地铺|website=凤凰网|access-date=2013-02-21|archive-url=https://web.archive.org/web/20130210051227/http://finance.ifeng.com/business/renwu/20130206/7650057.shtml|archive-date=2013-02-10|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1991年9月，任正非带着50多名员工来到深圳市宝安县（今[[宝安区]]）蚝业村工业大厦三楼，从一些国营单位买来散件，组装华为品牌的24扣小型单位用的程控交换机。{{sfn|李洪文|2019|p=35}}这种交换机属于成熟产品，技术含量不高，只需要按照电路图，把散件用电烙铁焊接到电路板上，然后装上说明书，贴上华为{{lang|en|BH01}}商标。{{sfn|李洪文|2019|p=35}}这款交换机由于电话接口少，功能简单，只能用于医院、矿山和小单位。{{sfn|李洪文|2019|p=36}}由于华为产品便宜，一经推出就供不应求，这时，国内散件也供不上货了。{{sfn|李洪文|2019|p=36}}为了摆脱这种不利局面，任正非让员工一边继续组装产品，一边自己开始搞研发。{{sfn|李洪文|2019|p=36}}当时华为分为单板、电源、总测、准备四个车间，剩下的就是仓库、厨房和宿舍。{{sfn|李洪文|2019|p=37}}任正非也和员工一样，吃住都在厂里，晚上还“熬猪尾巴汤”给员工喝。{{sfn|李洪文|2019|p=37}}由于研发是个无底洞，当时研发工作进行了6个多月，员工好几个月没有发工资了，任正非不得已，只得借24%的高利贷维持公司的正常运转。{{sfn|李洪文|2019|p=38}}一开始，研发组6名员工，没有专业测试设备，就是靠扩大镜对着上万个焊点，查找问题，和万用表，一条条测试线路，最后进行大量话务测试，所有员工放下手里的工作，每个人手里拿2个电话，拨号，接通，再挂机。{{sfn|李洪文|2019|p=38}}不久，公司就购买了大话务量测试设备，淘汰了大量人工测试的方法。{{sfn|李洪文|2019|p=38}}不久，{{lang|en|BH03}}交换机推出了，任正非自己背着军绿色的旧书包去推销这款产品。{{sfn|李洪文|2019|p=39}}为了解决销路问题，他开始接收代理商。{{sfn|李洪文|2019|p=41}}1991年12月31日晚上，华为举行庆祝{{lang|en|BH03}}交换机上市成功，会上，他站在一个纸箱子上，喊道：&amp;lt;blockquote&amp;gt;不拼，就活不下去！每周工作40个小时，只能产生普通的劳动者，不可能产生科学家、工程师，更不可能完成产业升级……20年后，全球通信产业三分天下，华为有其一！{{sfn|李洪文|2019|p=42}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Quote box | align = right | width = 26em | salign = right| quote =我创建公司时设计了员工持股制度，通过利益分享，团结起员工。那时我还不懂期权制度，更不知道西方在这方面很发达……仅凭自己过去的人生挫折，感悟到要和员工分担责任，分享利益。 | source =——2011年12月，任正非《一江春水向东流》{{sfn|余胜海|2017|p=61}}}}&lt;br /&gt;
1992年，任正非邀请[[华中科技大学]]、[[清华大学]]等高校的教授和学生来华为参观和访问。{{sfn|李洪文|2019|p=45}}华中科技大学教师郭平留了下来成为项目经理，当时负责{{lang|en|HJD48}}交换机研发，不久成为生产制造部负责人，后来成为常务副总裁。{{sfn|李洪文|2019|p=46}}郭平又请来了自己的同学郑宝用，郑宝用后来成为首任中央研究部负责人、常务副总裁、副董事长。{{sfn|李洪文|2019|p=47}}&lt;br /&gt;
&lt;br /&gt;
1992年，华为的总产值1个亿，总利税超过1000万。{{sfn|李洪文|2019|p=50}}1993年初，华为270多名员工在深圳市蛇口的一个小礼堂里，召开1992年总结大会，任正非在主席台上只讲了一句：“我们活下来了！”，同时决定研发局用交换机，进军公用电话电信领域。{{sfn|李洪文|2019|p=52}}会上颁发了100枚在香港定制的闪闪发光的金牌给优秀员工以及支持公司起步的香港鸿年公司的老板。{{sfn|李洪文|2019|p=52}}华为公司的旁边有一家亿利达集团公司，任正非从它那挖来了徐文伟，负责硬件。{{sfn|李洪文|2019|p=59}}为了挖掘人才，任正非还设置了“人才推荐奖”。{{sfn|李洪文|2019|p=90}}这一年，[[李一男]]正式加盟华为。{{sfn|李洪文|2019|p=88}}中国科技大学毕业生王文胜负责软件，和郑宝用，形成了华为的铁三角。{{sfn|李洪文|2019|p=59}}三人合作研发了{{lang|en|JK1000}}，使用模拟电子技术。{{sfn|李洪文|2019|p=60}}正是这款产品，让任正非尝到了没有跟上时代脚步的错误。{{sfn|李洪文|2019|p=60}}当时一名工人曹贻安给任正非建言要他关注数字电子技术，后来被升职为副总工程师。{{sfn|李洪文|2019|p=61}}孙亚芳带着200万资金加盟华为。{{sfn|李洪文|2019|p=62}}当时资金紧张，华为的工资是发一半，另一半记在账上，任正非把另一半记账的工资转换为华为的股份，辞职时可以取回股份兑换现金，这就是华为“人人股份制”的由来，这种政策造成了数以千计的百万富翁。{{sfn|李洪文|2019|p=63}}为了解决华为流动资金短缺的问题，孙亚芳建议可以和电信局一起，组建一个合资公司，不久，华为和17省市的电信局组建了“莫贝克”公司，17省市电信局注资了3900万元。{{sfn|李洪文|2019|p=65}}1993年5月，任正非主持召开市场部经理会议，正式推出{{lang|en|JK1000}}局用机，之后卖出200多台，因为技术和市场的原因，{{lang|en|JK1000}}局用机失败了。{{sfn|李洪文|2019|p=70}}&lt;br /&gt;
&lt;br /&gt;
1993年，华为研发数字交换机，取名{{lang|en|C&amp;amp;C08}}，包含三个意思“农村和城市”、“计算机和通信”、“中国和通信”。{{sfn|李洪文|2019|p=78}}1993年10月，交换机拿到浙江省[[义乌市]][[佛堂镇]]开局。{{sfn|李洪文|2019|p=80}}但是经常断线和死机。{{sfn|李洪文|2019|p=81}}郑宝用亲自带队十几名工程师现场调试，两个月后，{{lang|en|C&amp;amp;C08}}交换机可以正常工作了。{{sfn|李洪文|2019|p=80}}接着{{lang|en|C&amp;amp;C08}}交换机落户[[邳州市]]。{{sfn|李洪文|2019|p=108}}&lt;br /&gt;
&lt;br /&gt;
1995年，任正非邀请[[中国人民大学]]彭剑锋、包政、吴春波等教授到华为授课。{{sfn|李洪文|2019|p=138}}1996年3月，任正非邀请彭剑锋、包政、吴春波、黄卫伟、孙建敏、阳杜等组成华为《华为基本法》起草小组，黄卫伟主笔。{{sfn|李洪文|2019|p=140}}1998年完成。{{sfn|李洪文|2019|p=140}}《华为基本法》完成后，任正非在华为总部新基地门口立了一块石碑，上书：“一个企业长治久安的基础是接班人承认公司的核心价值观，并具有自我批判的能力。”{{sfn|余胜海|2017|p=98}}&lt;br /&gt;
&lt;br /&gt;
====收购港湾网络公司====&lt;br /&gt;
1998年，由于李一男和任平、郑宝用的矛盾，任正非将其调离中央研究部，去负责市场方面的产品部兼任行销部总裁。{{sfn|李洪文|2019|p=155}}李一男在产品部和同事格格不入，在2000年向任正非提出辞职。{{sfn|李洪文|2019|p=156}}任正非派手下的副总裁轮番上阵和李一男交流无果，在深圳市五洲宾馆给他举行了隆重的欢送大会。{{sfn|李洪文|2019|p=156}}同年年底，李一男带着分红和股权结算1000万元在北京成立“北京港湾网络有限公司”，一开始做华为企业网产品的高级分销商。{{sfn|李洪文|2019|p=157}}2001年，李一男开始从华为挖人才，包括国内市场主管副总裁彭松、通信部总经理路新等。{{sfn|李洪文|2019|p=160}}同年，美国华平投资公司给北京港湾网络有限公司注资1600万，龙科创投注资300万。{{sfn|李洪文|2019|p=161}}2002年，面对港湾网络公司抢夺市场和挖人，任正非下令收回华为授予港湾网络销售华为产品的代理权，并且成立“打港办”阻击港湾网络公司。{{sfn|李洪文|2019|p=177}}港湾网络公司选择去美国上市来圈回资金挽救公司，但是在其两次申请上市的过程中，美国证监会都收到大量匿名信，指出港湾网络公司侵权等一系列问题，导致上市失败。{{sfn|李洪文|2019|p=180}}2005年，任正非以100万的价格将港湾深圳研究所的语音小组全部挖到了华为。{{sfn|李洪文|2019|p=182}}2006年5月10日，任正非在杭州市华为{{lang|en|3COM}}总部会见李一男，6月6日，华为以17亿元的高价收购了港湾网络公司。{{sfn|李洪文|2019|p=183}}同年9月，李一男到深圳坂田华为公司总部上班，出任华为副总裁首席电信科学家，不久之后调到北京，在两年的收购绑定期后，李一男离开了华为。{{sfn|李洪文|2019|p=184}}&lt;br /&gt;
&lt;br /&gt;
====应对思科公司====&lt;br /&gt;
2002年，华为产品登陆[[美国]]市场。{{sfn|李洪文|2019|p=165}}同年6月参加美国[[亚特兰大]]举行的电信设备展，[[思科系统公司]]的总裁钱伯斯亲自到展台探查华为的产品。{{sfn|李洪文|2019|p=165}}同月，华为美国分公司{{lang|en|Future Wei}}在[[加利福尼亚州]][[圣克拉拉 (加利福尼亚州)|圣克拉拉市]]成立。{{sfn|李洪文|2019|p=166}}2003年1月，思科系统公司聘请美国研究知识产权的律师，向[[得克萨斯州]]马歇尔联邦法院递交了长达70多页的针对华为的诉状。{{sfn|李洪文|2019|p=168}}任正非召开高层会议，最后决定“敢打才能和，小输就是赢”。{{sfn|李洪文|2019|p=169}}华为常务副总裁郭平、徐文伟等人率队到美国应对诉讼，同时他还负责和美国{{lang|en|3COM}}公司谈判讨论合作。{{sfn|李洪文|2019|p=174}}2003年3月20日，华为和3COM正式成立合资公司，共同经营数据通信产品的研究开发、生产和销售。{{sfn|李洪文|2019|p=174}}2003年10月1日，双方律师对源代码比对工作结束，华为的源代码是“健康的”，次日达成初步和解协议。{{sfn|李洪文|2019|p=176}}2004年7月月底达成最终和解协议。{{sfn|李洪文|2019|p=176}}&lt;br /&gt;
&lt;br /&gt;
====拓展国际市场====&lt;br /&gt;
任正非瞄准国际市场分四步走，首先是临近的[[香港]]市场，第二是[[俄罗斯]]和[[南美洲]]，第三是[[东南亚]]、[[中东]]和[[非洲]]，第四是[[发达国家]]。{{sfn|余胜海|2017|p=244}}为了进军国际市场，任正非提出了“华为全球化”的思想：全球化的管理、全球化的研发、全球化的人才、全球化的销售和全球化的企业文化。{{sfn|余胜海|2017|p=262}}从1996年以来，任正非先后聘请{{lang|en|IBM}}等美国、英国十多家咨询公司对华为的研发、供应链、财务以及市场体系进行持续不断的变革，实行和{{lang|en|IBM}}一样的集成产品开发系统、集成供应链、人力资源管理、财务管理、质量控制。{{sfn|余胜海|2017|p=260}}2003年，{{lang|en|IBM}}专家撤离华为，业务变革项目宣告完成。{{sfn|余胜海|2017|p=17}}&lt;br /&gt;
&lt;br /&gt;
1996年，任正非带领华为第一步参与国际市场竞争的舞台，他和[[李嘉诚]]旗下的和记电讯合作，华为给它提供窄带交换机为核心产品的商业网产品。{{sfn|李洪文|2019|p=187}}{{sfn|余胜海|2017|p=244}}1997年，任正非派代表团访问俄罗斯，早在3年前，他就瞄准了俄罗斯巨大的市场，因经济困难，俄罗斯已经很多年没有升级改造了。{{sfn|李洪文|2019|p=191}}这一年，俄罗斯连续遭遇三次金融危机打击，许多国际企业都撤离了俄罗斯。{{sfn|李洪文|2019|p=193}}4月8日，任正非到俄罗斯乌法市，参加华为和俄罗斯合资公司“贝托华为”的签字仪式。{{sfn|李洪文|2019|p=195}}1998年8月，华为在[[也门]]和[[老挝]]中标，迎来了国际市场的零突破。{{sfn|李洪文|2019|p=195}}{{sfn|余胜海|2017|p=247}}2000年10月20日，任正非在欢送海外将士出征大会上发表了《雄赳赳，气昂昂，跨过太平洋》的讲话，指出“一个企业需要有全球性的战略眼光才能发愤图强；一个民族需要汲取全球性的精髓才能繁荣昌盛；一个公司需要建立全球性的商业生态系统才能生生不息；一个员工需要具备四海为家的胸怀和本领才能收获出类拔萃的职业生涯。”{{sfn|余胜海|2017|p=249}}2003年2月，希腊雅典奥运会承办方购买了华为全套的{{lang|en|GSM}}设备。{{sfn|余胜海|2017|p=246}}2004年12月，美国{{lang|en|CDMA}}运营商{{lang|en|NTCH}}宣布由华为承建{{lang|en|CDMA2000}}移动网络。{{sfn|余胜海|2017|p=247}}2005年4月28日，华为成为英国电信“八家企业短名单”的一家。同年，华为和法国{{lang|en|LDCOM}}公司合作参建法国国家干线{{lang|en|DWDM}}传输网。{{sfn|余胜海|2017|p=246}}&lt;br /&gt;
&lt;br /&gt;
2000年，被美国《[[福布斯]]》杂志评选为中国50富豪第3位。个人财产估计为5亿美元。2005年，任正非和章子怡入选《时代》周刊“世界最具影响力100人”名单。{{sfn|李洪文|2019|p=182}}2011年，任正非以11亿美元首次进入福布斯富豪榜，排名全球第1056名，中国第92名。&lt;br /&gt;
&lt;br /&gt;
{{Quote box | align = right | width = 26em | salign = right| quote =“轮值{{lang|en|CEO}}制度”，他们更多的是着眼公司的战略，着眼制度建设。将日常经营决策的权力进一步下放给各业务集团、区域，以推动扩张的合理进行。这比公司的成功系于一人，败也是这一人的制度要好。 | source =——2011年12月，任正非《一江春水向东流》{{sfn|余胜海|2017|p=67}}}}&lt;br /&gt;
2011年12月，任正非撰写《一江春水向东流》，经过一级、二级、三级管理团队的审阅修改后，发布在公司内部，正式宣布实行“轮值{{lang|en|CEO}}制度”，在公司创立之初解决利益分配的问题后，解决了权力分配和团队管理的两大问题。{{sfn|余胜海|2017|p=67}}一旦董事会形成决议，{{lang|en|CEO}}必须遵从。{{sfn|余胜海|2017|p=68}}“轮值{{lang|en|CEO}}制度”借鉴了美国政党轮替制度，避免了公司长期由一个人掌舵，解决了“山头文化”问题。{{sfn|余胜海|2017|p=68}}建立“轮值CEO制度”后，任正非也从公司的日常管理事务中解脱了出来，专心钻研华为的发展战略问题。{{sfn|余胜海|2017|p=68}}&lt;br /&gt;
&lt;br /&gt;
2015年1月，任正非与[[BBC]]主持人在[[世界经济论坛]]上讲话，称不会让[[中华人民共和国政府|中国政府]]去用华为的电信网络，听美国的秘密。&amp;lt;ref&amp;gt;{{Cite web |url=http://www.sh.xinhuanet.com/2015-01/23/c_133941425.htm |title=华为任正非：我们是中国公司 肯定拥护共产党 |accessdate=2015-01-24 |archive-date=2016-09-14 |archive-url=https://web.archive.org/web/20160914102252/http://www.sh.xinhuanet.com/2015-01/23/c_133941425.htm |dead-url=yes }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2018年，被评为“改革开放40年百名杰出民营企业家”之一。&amp;lt;ref&amp;gt;{{Cite web|url=https://www.huawei.com/cn/about-huawei/executives/board-of-directors/ren-zhengfei|title=任正非先生 - 华为管理层信息|accessdate=2018-12-06|work=huawei|archive-url=https://web.archive.org/web/20181104170047/https://www.huawei.com/cn/about-huawei/executives/board-of-directors/ren-zhengfei|archive-date=2018-11-04|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==爭議與担忧==&lt;br /&gt;
{{main|华为#爭議|对华为的争议}}&lt;br /&gt;
{{Globalize|章節|date=2024年1月}}&lt;br /&gt;
[[印度政府]]因对任正非可能与[[中国人民解放军]]有联系的担忧而将此作为不允许华为赢得印度某些合同的安全顾虑。&amp;lt;ref&amp;gt;{{cite news |last=Ashford |first=Warwick |date=2009-06-04 |title=Huawei complains about India&#039;s security concerns |language=en-GB |website=ComputerWeekly.com |url=http://www.computerweekly.com/news/2240089593/Huawei-complains-about-Indias-security-concerns |url-status=live |access-date=2018-02-15 |archive-url=https://web.archive.org/web/20180215143816/http://www.computerweekly.com/news/2240089593/Huawei-complains-about-Indias-security-concerns |archive-date=15 February 2018}}&amp;lt;/ref&amp;gt; 一些国家也交流了这些担忧。在[[美国]]，这导致华为购买[[3Com]]的努力失败，并迫使[[软银]]为了使其对[[斯普林特]]的收购获得美国国家安全许可而大幅削减与华为的联系。而在英国，[[議會情報與安全委員會|情报与安全委员会]]已经因为间谍担忧建议移除华为设备。&amp;lt;ref&amp;gt;{{cite news |date=30 May 2013 |title=Huawei Loser in SoftBank-Sprint Deal Over Alleged Spying |publisher=Bloomberg |url=https://www.bloomberg.com/news/2013-05-29/huawei-loser-in-softbank-sprint-deal-over-alleged-spying.html |url-status=live |access-date=4 July 2013 |archive-url=https://web.archive.org/web/20130617235019/http://www.bloomberg.com/news/2013-05-29/huawei-loser-in-softbank-sprint-deal-over-alleged-spying.html |archive-date=17 June 2013}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite news |date=6 June 2013 |title=Like U.S. lawmakers, Brits raise spying fears over Huawei gear |publisher=CNET |url=https://news.cnet.com/8301-1035_3-57588045-94/like-u.s-lawmakers-brits-raise-spying-fears-over-huawei-gear/ |url-status=live |access-date=4 July 2013 |archive-url=https://web.archive.org/web/20131109203207/http://news.cnet.com/8301-1035_3-57588045-94/like-u.s-lawmakers-brits-raise-spying-fears-over-huawei-gear/ |archive-date=9 November 2013}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==著作==&lt;br /&gt;
*电子版《任正非精彩讲话集》，收50篇讲话记录稿。&lt;br /&gt;
*电子版《任正非文集1994-2019》包含1994年到2018年的几乎所有讲话400余篇，内容涉及对行政、财经、产品、MKT、公关、研发、个人成长、战略、历史、政治等方面的看法。&lt;br /&gt;
&lt;br /&gt;
== 家庭 ==&lt;br /&gt;
任正非第一任妻子为孟军，为[[四川省]]前副省长[[孟东波]]之女，兩人育有一子一女，長女[[孟晚舟]]後來成為华为副董事长，次子孟平，長大後改回父姓[[任平]]。&lt;br /&gt;
&lt;br /&gt;
第二任妻子为姚凌&amp;lt;ref name=&amp;quot;tech163_20190521&amp;quot;&amp;gt;{{Cite web|url=http://tech.163.com/19/0521/19/EFNMKMG900097U7T.html|title=任正非:我流泪了! 150分钟采访完整实录解密美国禁令下的任正非|accessdate=2019-05-22|date=2019-05-21|last=网易|work=tech.163.com|archive-date=2019-12-10|archive-url=https://web.archive.org/web/20191210093128/http://tech.163.com/19/0521/19/EFNMKMG900097U7T.html|dead-url=no}}&amp;lt;/ref&amp;gt;，育有一女[[姚安娜 (任正非之女)|姚安娜]]（Annabel Yao，1998年1月14日-）。姚安娜原名姚思为，曾练习芭蕾舞，本科毕业于哈佛大学计算机科学与统计学专业，2021年1月签约天浩盛世出道。&amp;lt;ref&amp;gt;{{Cite news |url=https://finance.sina.com.cn/tech/2021-01-14/doc-ikftssan5942374.shtml |title=任正非之女姚安娜正式出道 官方海报曝光（图） |date=2021-01-14 |work=三言财经 |via=新浪 |accessdate=2021-01-15 |archive-date=2021-01-21 |archive-url=https://web.archive.org/web/20210121014019/https://finance.sina.com.cn/tech/2021-01-14/doc-ikftssan5942374.shtml |dead-url=no }}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite news |url=https://finance.sina.com.cn/tech/2021-01-15/doc-ikftssan6253856.shtml |title=热搜第一！任正非的小女儿宣布进军娱乐圈 |date=2021-01-15 |work=每日经济新闻 |via=新浪 |accessdate=2021-01-15 |archive-date=2021-01-21 |archive-url=https://web.archive.org/web/20210121201256/https://finance.sina.com.cn/tech/2021-01-15/doc-ikftssan6253856.shtml |dead-url=no }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2018年12月，有报道称任正非现任妻子为苏薇。&amp;lt;ref&amp;gt;{{cite web|url=https://www.scmp.com/lifestyle/article/2176660/why-two-daughters-huawei-founder-have-different-names-and-not-their|title=The tale of Huawei founder’s daughters, born 25 years apart|date=2018-12-06|website=South China Morning Post|access-date=2018-12-07|archive-url=https://web.archive.org/web/20181207110644/https://www.scmp.com/lifestyle/article/2176660/why-two-daughters-huawei-founder-have-different-names-and-not-their|archive-date=2018-12-07|dead-url=no}}&amp;lt;/ref&amp;gt;但任正非在2019年5月21日接受采访时称其一生共有2次婚姻，现任妻子为姚凌。&amp;lt;ref name=&amp;quot;tech163_20190521&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==軼聞==&lt;br /&gt;
===論知識===&lt;br /&gt;
任正非唯一的业余爱好就是阅读，尤其是政治、经济、社会和人文方面的书籍。{{sfn|余胜海|2017|p=132}}下班后，不是看书就是看电视。{{sfn|余胜海|2017|p=131}}几十年来，任正非出差时必带的物品就是书籍，基本一个星期读一二本书，每天看几本杂志。{{sfn|余胜海|2017|p=131}}任正非自己说多閱讀是：“我阅读速度非常快，书读得很多，不知哪本书影响了我，哪件事影响了我，思想是怎么生成的。我脑袋里产生的想法我也找不到源头在哪里。”{{sfn|余胜海|2017|p=131}}。對於讀書，中央社轉述香港媒體的採訪，據南華早報（SCMP）報導說，中國近來推教改減少英語教學時段，而任面對不學英語的浪潮，則是回應，這樣的人怎麼到公司上班就業？有次他與南開大學新聞與傳播學院院長、「科技日報」前總編輯劉亞東暢談公司發展、美國，也談到學英文，任正非在談話中指出，不學英文的話「農村孩子永遠是農夫」，並認為中國的教育太同質化與集體化，想要超越西方就應該好好學振興多元文化，讓天才自由發揮&amp;lt;ref&amp;gt;{{cite web|title=中國「英語教育」式微？華為任正非：不學英文，農村孩子永遠是農夫|url=https://www.gvm.com.tw/article/106523|access-date=2023-11-29|archive-date=2023-10-03|archive-url=https://web.archive.org/web/20231003023527/https://www.gvm.com.tw/article/106523|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web|title=中國浮現不學英文聲浪　華為創辦人任正非：將來在這個世界怎麼就業啊？|url=https://www.storm.mg/article/4873433|access-date=2023-11-29|archive-date=2023-10-12|archive-url=https://web.archive.org/web/20231012034619/https://www.storm.mg/article/4873433|dead-url=no}}&amp;lt;/ref&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
===對美國產品的看法===&lt;br /&gt;
據《[[富比士]]》雜誌報導，為了凸顯華為的5G技術，特別用蘋果舉例誇讚，他還喜愛把玩蘋果新產品研究並送給身邊的人，全家人都使用iPhone、華為的任正非並在接受彭博採訪時認為：他身為領導會第一個出來反對排斥美商，他並稱有競爭與選擇是好事，才有今天不停的進步。後來2023年9月份，又在北京一次[[國際大學生程式設計競賽]]（ICPC）上，對年輕人鼓勵，自家體驗Apple生態就感覺方便又好用，所以要把蘋果當作重要的老師，自嘲身為果粉也不為過，勉勵學子多互通不要排外&amp;lt;ref&amp;gt;{{cite web|title=華為總裁任正非稱蘋果是其老師，被網民讚揚“理性”、“大氣”|url=https://www.voacantonese.com/a/huawei-apple-ren-zhengfei-20230919/7276039.html|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web|title=華為任正非盛讚蘋果！稱iPhone 12是最棒的5G手機|url=https://newtalk.tw/news/view/2021-02-17/537356|dead-url=no|access-date=2023-10-06|archive-date=2023-04-01|archive-url=https://web.archive.org/web/20230401213702/https://newtalk.tw/news/view/2021-02-17/537356}}&amp;lt;/ref&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
== 参考文献 ==&lt;br /&gt;
{{Reflist|3}}&lt;br /&gt;
&lt;br /&gt;
==参考书目==&lt;br /&gt;
*{{cite book |author1=李洪文 |title=《任正非：九死一生的坚持》 |year=2019 |publisher=中国言实出版社 |location=北京市西城区 |isbn=978-7-5171-0551-0|ref=harv}}&lt;br /&gt;
&lt;br /&gt;
*{{cite book |author1=余胜海 |chapter=〈生存之道：不奋斗就没有未来〉 |title=《任正非和华为 非常人 非常道》 |date=2017-02-01 |publisher=长江文艺出版社 |location=湖北省武汉市 |isbn=978-7-5354-7702-6|ref=harv}}&lt;br /&gt;
&lt;br /&gt;
*{{cite book |author1=曲智 |title=《任正非内部讲话：关键时，任正非说了什么》 |date=2013-01-01 |publisher=新世界出版社 |location=北京市 |isbn=9787510430305}}&lt;br /&gt;
&lt;br /&gt;
*{{cite book |author1=赵凡|author2=禹燕军 |title=《任正非传》 |date=2010 |publisher=华中科技大学出版社 |location=湖北省武汉市 |isbn= }}&lt;br /&gt;
&lt;br /&gt;
*{{cite book |author1= |chapter=周君藏 |title=《任正非这个人》 |date=2011-04-01 |publisher=中信出版社 |location=北京市 |isbn=9787508627083}}&lt;br /&gt;
&lt;br /&gt;
== 外部链接 ==&lt;br /&gt;
;文学作品：&lt;br /&gt;
* [https://web.archive.org/web/20060718055149/http://home.donews.com/donews/article/5/55943.html 我的父亲母亲]&lt;br /&gt;
* [https://web.archive.org/web/20081029221218/http://www.tcnet.com.cn/tcsite/idnptech/41.asp 华为的冬天]&lt;br /&gt;
&lt;br /&gt;
{{Clear}}&lt;br /&gt;
{{-}}&lt;br /&gt;
{{s-start}}&lt;br /&gt;
{{s-bus}}&lt;br /&gt;
{{s-new}}&lt;br /&gt;
{{s-ttl|title=华为技术有限公司副董事长|years=1987年–2019年}}&lt;br /&gt;
{{s-aft|after=[[孟晚舟]]}}&lt;br /&gt;
{{s-new}}&lt;br /&gt;
{{s-ttl|title=华为技术有限公司总裁兼首席执行官|years=1987年–现在}}&lt;br /&gt;
{{s-inc}}&lt;br /&gt;
{{s-end}}&lt;br /&gt;
{{Wikiquote|任正非}}&lt;br /&gt;
{{胡润百富榜}}&lt;br /&gt;
{{华为}}&lt;br /&gt;
&lt;br /&gt;
{{Authority control}}&lt;br /&gt;
{{DEFAULTSORT:Ren任}}&lt;br /&gt;
[[Category:任姓|Zheng正]]&lt;br /&gt;
[[Category:浦江人]]&lt;br /&gt;
[[Category:重庆建筑工程学院校友]]&lt;br /&gt;
[[Category:华为人物]]&lt;br /&gt;
[[Category:中华人民共和国企业家]]&lt;br /&gt;
[[Category:1978年加入中國共產黨的人物]]&lt;br /&gt;
[[Category:军人出身的商人]]&lt;br /&gt;
[[Category:中共十二大代表]]&lt;br /&gt;
[[Category:时代百大人物]]&lt;br /&gt;
[[Category:改革开放40年百名杰出民营企业家]]&lt;br /&gt;
[[Category:任正非家族]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E8%B0%A2%E5%AF%92&amp;diff=2222</id>
		<title>谢寒</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E8%B0%A2%E5%AF%92&amp;diff=2222"/>
		<updated>2025-09-28T17:53:26Z</updated>

		<summary type="html">&lt;p&gt;Admin：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;谢寒&#039;&#039;&#039;（拼音：Xiè Hán），中国互联网创业者、个人站长与文化传媒从业者。以“AI百科建站计划”及其衍生的“AI百科平台矩阵计划”闻名，计划在 2025–2026 年间打造 100 个 AI 驱动的百科网站，探索人工智能在知识管理、媒体传播及数字平台商业化中的应用。&lt;br /&gt;
[[文件:谢寒.jpg|替代=谢寒少爷|缩略图|谢寒少爷]]&lt;br /&gt;
&lt;br /&gt;
=== 生平与事业 ===&lt;br /&gt;
谢寒长期从事网站建设、域名运营与新媒体平台开发，拥有大量优质中文域名资源，涵盖百科、视频、新闻、门户、搜索等多个垂直领域。他以个人身份运营并推动多个在线项目，包括：&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;AI百科创富计划&#039;&#039;&#039;：通过批量化 AI 内容生成和百科平台建设，形成百站矩阵，目标在 2026 年世界杯前完成，并通过条目收费、广告、整站出售等方式实现超过 100 万元的现金收益。&lt;br /&gt;
* &#039;&#039;&#039;阿哩阿哩（aliali.cn）&#039;&#039;&#039;：动漫视频网站，注册有“阿哩阿哩”商标，并曾成功应对阿里巴巴集团发起的商标无效申请。&lt;br /&gt;
* &#039;&#039;&#039;ChnGPT（chngpt.com）&#039;&#039;&#039;：中国本土 GPT 平台，集成百度千帆大模型，支持流式对话输出与无登录使用。&lt;br /&gt;
&lt;br /&gt;
此外，他还涉足视频直播、新闻门户、AI 搜索引擎（DeepSoo）、文化传媒（追梦人文化传媒）等领域，致力于打造多元化的数字生态。&lt;br /&gt;
&lt;br /&gt;
=== 项目与影响 ===&lt;br /&gt;
谢寒提出“AI百科矩阵”模式，尝试用 AI 技术实现百科网站的规模化生产与商业变现。这一模式被视为对传统百科平台的一种创新性挑战，反映了人工智能在数字内容产业的快速渗透。&lt;br /&gt;
&lt;br /&gt;
=== 相关条目 ===&lt;br /&gt;
&lt;br /&gt;
* AI百科&lt;br /&gt;
* 中文百科&lt;br /&gt;
* ChnGPT&lt;br /&gt;
* 阿哩阿哩（动漫视频网站）&lt;br /&gt;
&lt;br /&gt;
=== 注释 ===&lt;br /&gt;
（此处需引用媒体报道、新闻稿、采访、或其他第三方可靠来源）&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%96%87%E4%BB%B6:%E8%B0%A2%E5%AF%92.jpg&amp;diff=2221</id>
		<title>文件:谢寒.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%96%87%E4%BB%B6:%E8%B0%A2%E5%AF%92.jpg&amp;diff=2221"/>
		<updated>2025-09-28T17:53:05Z</updated>

		<summary type="html">&lt;p&gt;Admin：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;谢寒&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E8%B0%A2%E5%AF%92&amp;diff=2220</id>
		<title>谢寒</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E8%B0%A2%E5%AF%92&amp;diff=2220"/>
		<updated>2025-09-28T17:44:51Z</updated>

		<summary type="html">&lt;p&gt;Admin：​创建页面，内容为“&amp;#039;&amp;#039;&amp;#039;谢寒&amp;#039;&amp;#039;&amp;#039;（拼音：Xiè Hán），中国互联网创业者、个人站长与文化传媒从业者。以“AI百科建站计划”及其衍生的“AI百科平台矩阵计划”闻名，计划在 2025–2026 年间打造 100 个 AI 驱动的百科网站，探索人工智能在知识管理、媒体传播及数字平台商业化中的应用。  === 生平与事业 === 谢寒长期从事网站建设、域名运营与新媒体平台开发，拥有大量优质…”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;谢寒&#039;&#039;&#039;（拼音：Xiè Hán），中国互联网创业者、个人站长与文化传媒从业者。以“AI百科建站计划”及其衍生的“AI百科平台矩阵计划”闻名，计划在 2025–2026 年间打造 100 个 AI 驱动的百科网站，探索人工智能在知识管理、媒体传播及数字平台商业化中的应用。&lt;br /&gt;
&lt;br /&gt;
=== 生平与事业 ===&lt;br /&gt;
谢寒长期从事网站建设、域名运营与新媒体平台开发，拥有大量优质中文域名资源，涵盖百科、视频、新闻、门户、搜索等多个垂直领域。他以个人身份运营并推动多个在线项目，包括：&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;AI百科创富计划&#039;&#039;&#039;：通过批量化 AI 内容生成和百科平台建设，形成百站矩阵，目标在 2026 年世界杯前完成，并通过条目收费、广告、整站出售等方式实现超过 100 万元的现金收益。&lt;br /&gt;
* &#039;&#039;&#039;阿哩阿哩（aliali.cn）&#039;&#039;&#039;：动漫视频网站，注册有“阿哩阿哩”商标，并曾成功应对阿里巴巴集团发起的商标无效申请。&lt;br /&gt;
* &#039;&#039;&#039;ChnGPT（chngpt.com）&#039;&#039;&#039;：中国本土 GPT 平台，集成百度千帆大模型，支持流式对话输出与无登录使用。&lt;br /&gt;
&lt;br /&gt;
此外，他还涉足视频直播、新闻门户、AI 搜索引擎（DeepSoo）、文化传媒（追梦人文化传媒）等领域，致力于打造多元化的数字生态。&lt;br /&gt;
&lt;br /&gt;
=== 项目与影响 ===&lt;br /&gt;
谢寒提出“AI百科矩阵”模式，尝试用 AI 技术实现百科网站的规模化生产与商业变现。这一模式被视为对传统百科平台的一种创新性挑战，反映了人工智能在数字内容产业的快速渗透。&lt;br /&gt;
&lt;br /&gt;
=== 相关条目 ===&lt;br /&gt;
&lt;br /&gt;
* AI百科&lt;br /&gt;
* 中文百科&lt;br /&gt;
* ChnGPT&lt;br /&gt;
* 阿哩阿哩（动漫视频网站）&lt;br /&gt;
&lt;br /&gt;
=== 注释 ===&lt;br /&gt;
（此处需引用媒体报道、新闻稿、采访、或其他第三方可靠来源）&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Reflist&amp;diff=2219</id>
		<title>模板:Reflist</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Reflist&amp;diff=2219"/>
		<updated>2025-09-28T17:40:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​页面内容被替换为“&amp;lt;div class=&amp;quot;references-small&amp;quot;&amp;gt;（参考资料略）&amp;lt;/div&amp;gt;”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;references-small&amp;quot;&amp;gt;（参考资料略）&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_web&amp;diff=2218</id>
		<title>模板:Cite web</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_web&amp;diff=2218"/>
		<updated>2025-09-28T17:39:47Z</updated>

		<summary type="html">&lt;p&gt;Admin：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span class=&amp;quot;reference&amp;quot;&amp;gt;[外部链接]&amp;lt;/span&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Reflist/styles.css&amp;diff=1151</id>
		<title>模板:Reflist/styles.css</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Reflist/styles.css&amp;diff=1151"/>
		<updated>2025-09-28T16:18:31Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.reflist {&lt;br /&gt;
	margin-bottom: 0.5em;&lt;br /&gt;
	list-style-type: decimal;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen {&lt;br /&gt;
	/* can we remove the font size declarations? .references gets a font-size in&lt;br /&gt;
	 * common.css that is always 90, and there is nothing else in reflist out in&lt;br /&gt;
	 * the wild. May affect column sizes.&lt;br /&gt;
	 */&lt;br /&gt;
	 /* make smaller only on screens */&lt;br /&gt;
	.reflist {&lt;br /&gt;
		font-size: 90%;        /* Default font-size */&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist .references {&lt;br /&gt;
	font-size: 100%;           /* Reset font-size when nested in .reflist */&lt;br /&gt;
	margin-bottom: 0;          /* Avoid double margin when nested in .reflist */&lt;br /&gt;
	list-style-type: inherit;  /* Enable custom list style types */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* columns-2 and columns-3 are legacy for &amp;quot;2 or more&amp;quot; column view from when the&lt;br /&gt;
 * template was implemented with column-count.&lt;br /&gt;
 */&lt;br /&gt;
.reflist-columns-2 {&lt;br /&gt;
	column-width: 30em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-columns-3 {&lt;br /&gt;
	column-width: 25em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Reset top margin for lists embedded in columns */&lt;br /&gt;
.reflist-columns {&lt;br /&gt;
	margin-top: 0.3em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-columns ol {&lt;br /&gt;
	margin-top: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Avoid elements breaking between columns */&lt;br /&gt;
.reflist-columns li {&lt;br /&gt;
	page-break-inside: avoid; /* Removed from CSS in favor of break-inside c. 2020 */&lt;br /&gt;
	break-inside: avoid-column;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-upper-alpha {&lt;br /&gt;
	list-style-type: upper-alpha;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-upper-roman {&lt;br /&gt;
	list-style-type: upper-roman;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-lower-alpha {&lt;br /&gt;
	list-style-type: lower-alpha;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-lower-greek {&lt;br /&gt;
	list-style-type: lower-greek;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.reflist-lower-roman {&lt;br /&gt;
	list-style-type: lower-roman;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Citation/styles.css&amp;diff=1149</id>
		<title>模板:Citation/styles.css</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Citation/styles.css&amp;diff=1149"/>
		<updated>2025-09-28T16:18:31Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/*&lt;br /&gt;
 * This page is a convenient place for the &amp;quot;citation&amp;quot; styles that are&lt;br /&gt;
 * available in many of our citation templates. This page can be considered the&lt;br /&gt;
 * authoritative source for those styles. [[Template:Citation]], like all CS1/2&lt;br /&gt;
 * templates, is styled from [[Module:Citation/CS1/styles.css]], *not* here.&lt;br /&gt;
 */&lt;br /&gt;
/* Break long urls, etc., rather than overflowing box */&lt;br /&gt;
.citation {&lt;br /&gt;
	word-wrap: break-word;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Highlight linked elements (such as clicked references) in blue */&lt;br /&gt;
.citation:target {&lt;br /&gt;
	/* ignore the linter - all browsers of interest implement this */&lt;br /&gt;
	background-color: rgba(0, 127, 255, 0.133);&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cs2&amp;diff=502</id>
		<title>模板:Cs2</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cs2&amp;diff=502"/>
		<updated>2025-09-28T15:23:36Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Help:引文格式2|引文格式2]]&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:文件支援模板]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1/doc&amp;diff=500</id>
		<title>模块:Citation/CS1/doc</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1/doc&amp;diff=500"/>
		<updated>2025-09-28T15:23:36Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation subpage}}&amp;lt;!-- 在本行下編輯模組說明 --&amp;gt;&lt;br /&gt;
&amp;lt;section begin=header /&amp;gt;&lt;br /&gt;
&amp;lt;!-- {{sandbox other||&lt;br /&gt;
{{#switch:{{FULLPAGENAME}}&lt;br /&gt;
|Module:Citation/CS1={{high-risk|650309}} {{Uses TemplateStyles|Module:Citation/CS1/styles.css}}&lt;br /&gt;
|Module:Citation/CS1/Configuration={{high-risk}}&lt;br /&gt;
|Module:Citation/CS1/Whitelist={{high-risk}}&lt;br /&gt;
|Module:Citation/CS1/Date validation={{high-risk}}&lt;br /&gt;
|Module:Citation/CS1/Identifiers={{high-risk}}&lt;br /&gt;
|Module:Citation/CS1/Utilities={{high-risk}}&lt;br /&gt;
|Module:Citation/CS1/COinS={{high-risk}}&lt;br /&gt;
|Module:Citation/CS1/Suggestions={{high-use}}&lt;br /&gt;
}} high-risk尚未改造 只能用于页面本身--&amp;gt;&lt;br /&gt;
&amp;lt;!-- {{Module rating|p}} 未评级--&amp;gt;   &amp;lt;!-- if pagename does not contain sandbox --&amp;gt;&lt;br /&gt;
&amp;lt;section end=header /&amp;gt;此模块及关联的子页面为{{cs1}}和{{cs2}}引用模板提供支持。通常来说不应直接调用此模块，而是用CS1与CS2模板调用。&lt;br /&gt;
&amp;lt;section begin=module_components_table /&amp;gt;&lt;br /&gt;
如下文件涉及对CS1与CS2引用模板的支持：&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+CS1 {{pipe}} CS2模块&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;| 线上 !!colspan=&amp;quot;2&amp;quot;|沙盒!!描述&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;12&amp;quot;| [[File:Full-protection-shackle.svg|20px|alt=Gold padlock|link=|sysop]] || [[Module:Citation/CS1]] || [[Module:Citation/CS1/sandbox]] || [[Special:EditPage/Module:Citation/CS1/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 主模块，依输入的模板参数生成相应的引文&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Configuration]] || [[Module:Citation/CS1/Configuration/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Configuration/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 配置表&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Whitelist]] || [[Module:Citation/CS1/Whitelist/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Whitelist/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 现行与已过时不推荐使用的CS1与CS2参数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Date validation]] || [[Module:Citation/CS1/Date validation/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Date_validation/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 日期格式验证函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Error]] || [[Module:Citation/CS1/Error/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Error/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 错误/维护信息相关函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Identifiers]] || [[Module:Citation/CS1/Identifiers/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Identifiers/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 支持命名标识符（ISBN、DOI、PMID等）的函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Language]] || [[Module:Citation/CS1/Language/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Language/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 语言相关函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Links]] || [[Module:Citation/CS1/Links/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Links/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 维基内、外链相关函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/People]] || [[Module:Citation/CS1/People/sandbox]] || [[Special:EditPage/Module:Citation/CS1/People/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 人名列表相关函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/Utilities]] || [[Module:Citation/CS1/Utilities/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Utilities/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 简单无副作用的辅助函数（主要为字串/格式相关）&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/COinS]] || [[Module:Citation/CS1/COinS/sandbox]] || [[Special:EditPage/Module:Citation/CS1/COinS/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 支持CS1与CS2模板元数据渲染的函数&lt;br /&gt;
|-&lt;br /&gt;
| [[Module:Citation/CS1/styles.css]] || [[Module:Citation/CS1/sandbox/styles.css]] || [[Special:EditPage/Module:Citation/CS1/sandbox/styles.css|[编辑]&amp;lt;nowiki/&amp;gt;]] || 为CS1与CS2模板提供[[CSS]]样式&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Semi-protection-shackle.svg|20px|alt=Silver padlock|link=|auto confirmed]] || [[Module:Citation/CS1/Suggestions]] || [[Module:Citation/CS1/Suggestions/sandbox]] || [[Special:EditPage/Module:Citation/CS1/Suggestions/sandbox|[编辑]&amp;lt;nowiki/&amp;gt;]] || 将常见错误参数名映射到有效参数名的列表&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;section end=module_components_table /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
其他文档：&lt;br /&gt;
* [[Module talk:Citation/CS1/Feature requests]] ([[:en:Module talk:Citation/CS1/Feature requests|enwiki]])&lt;br /&gt;
* [[Module talk:Citation/CS1/COinS]] ([[:en:Module talk:Citation/CS1/COinS|enwiki]])&lt;br /&gt;
* [[Module:Cs1 documentation support]] ([[:en:Module:Cs1 documentation support|enwiki]]) – 一套函数（部分实验性），从模块套件中提取信息以文档化CS1与CS2&lt;br /&gt;
** [[Module:Citation/CS1/doc/Category list]] – 从[[Module:Citation/CS1/Configuration]]和[[Module:Citation/CS1/Configuration/sandbox]]直接提取的分类名称列表&lt;br /&gt;
测试用例：&lt;br /&gt;
*[[Module:Citation/CS1/testcases]] ([[Module talk:Citation/CS1/testcases|运行]])&lt;br /&gt;
*[[Module:Citation/CS1/testcases/errors]] ([[Module talk:Citation/CS1/testcases/errors|运行]]) – 错误及维护消息&lt;br /&gt;
*[[Module:Citation/CS1/testcases/dates]] ([[Module talk:Citation/CS1/testcases/dates|运行]]) – 数据验证&lt;br /&gt;
*[[Module:Citation/CS1/testcases/identifiers]] ([[Module talk:Citation/CS1/testcases/identifiers|运行]]) – 标识符&lt;br /&gt;
*[[Module:Citation/CS1/testcases/anchor]] ([[Module talk:Citation/CS1/testcases/anchor|运行]]) – CITEREF作者&lt;br /&gt;
调试：&lt;br /&gt;
欲调试该模块，可通过在编辑框下方的“调试控制台”中输入以下代码查看模块的返回值：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Lua&amp;quot;&amp;gt;mw.logObject(p.citation(mw.getCurrentFrame():newChild{args = {--[[此处填写调试用的模板参数，例如[&#039;title&#039;] = &#039;test&#039;, [&#039;url&#039;] = &#039;http://example.com&#039;]] }}))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- 本行下加入模組的分類 --&amp;gt;&lt;br /&gt;
[[Category:添加追踪分类的模块]]&lt;br /&gt;
{{#ifeq:{{SUBPAGENAME}}|Identifiers|[[Category:使用维基数据信息的模块]]}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cs1&amp;diff=498</id>
		<title>模板:Cs1</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cs1&amp;diff=498"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Help:引文格式1|引文格式1]]&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:輸入支援模板]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Pipe&amp;diff=496</id>
		<title>模板:Pipe</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Pipe&amp;diff=496"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;#124;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories and interwikis to the /doc subpage, not here! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Protection_banner/config&amp;diff=494</id>
		<title>模块:Protection banner/config</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Protection_banner/config&amp;diff=494"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides configuration data for [[Module:Protection banner]].&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                                BANNER DATA&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- Banner data consists of six fields:&lt;br /&gt;
-- * text - the main protection text that appears at the top of protection&lt;br /&gt;
--   banners.&lt;br /&gt;
-- * explanation - the text that appears below the main protection text, used&lt;br /&gt;
--   to explain the details of the protection.&lt;br /&gt;
-- * tooltip - the tooltip text you see when you move the mouse over a small&lt;br /&gt;
--   padlock icon.&lt;br /&gt;
-- * link - the page that the small padlock icon links to.&lt;br /&gt;
-- * alt - the alt text for the small padlock icon. This is also used as tooltip&lt;br /&gt;
--   text for the large protection banners.&lt;br /&gt;
-- * image - the padlock image used in both protection banners and small padlock&lt;br /&gt;
--   icons.&lt;br /&gt;
--&lt;br /&gt;
-- The module checks in three separate tables to find a value for each field.&lt;br /&gt;
-- First it checks the banners table, which has values specific to the reason&lt;br /&gt;
-- for the page being protected. Then the module checks the defaultBanners&lt;br /&gt;
-- table, which has values specific to each protection level. Finally, the&lt;br /&gt;
-- module checks the masterBanner table, which holds data for protection&lt;br /&gt;
-- templates to use if no data has been found in the previous two tables.&lt;br /&gt;
--&lt;br /&gt;
-- The values in the banner data can take parameters. These are specified&lt;br /&gt;
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name&lt;br /&gt;
-- enclosed in curly braces).&lt;br /&gt;
--&lt;br /&gt;
--                          Available parameters:&lt;br /&gt;
--&lt;br /&gt;
-- ${CURRENTVERSION} - a link to the page history or the move log, with the&lt;br /&gt;
-- display message &amp;quot;current-version-edit-display&amp;quot; or&lt;br /&gt;
-- &amp;quot;current-version-move-display&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- ${EDITREQUEST} - a link to create an edit request for the current page.&lt;br /&gt;
--&lt;br /&gt;
-- ${EXPIRY} - the protection expiry date in the format DD Month YYYY. If&lt;br /&gt;
-- protection is indefinite or is not set, this is the blank string.&lt;br /&gt;
--&lt;br /&gt;
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. &amp;quot;Please discuss any changes&lt;br /&gt;
-- on the talk page; you may submit a request to ask an administrator to make&lt;br /&gt;
-- an edit if it is minor or supported by consensus.&amp;quot;&lt;br /&gt;
--&lt;br /&gt;
-- ${IMAGELINK} - a link to set the image to, depending on the protection&lt;br /&gt;
-- action and protection level.&lt;br /&gt;
--&lt;br /&gt;
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry&lt;br /&gt;
-- is set. E.g. &amp;quot;Editing of this page by new or unregistered users is currently&lt;br /&gt;
-- disabled until dd Month YYYY.&amp;quot;&lt;br /&gt;
--&lt;br /&gt;
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation&lt;br /&gt;
-- so that it can be used in run-on sentences.&lt;br /&gt;
--&lt;br /&gt;
-- ${PAGETYPE} - the type of the page, e.g. &amp;quot;article&amp;quot; or &amp;quot;template&amp;quot;.&lt;br /&gt;
-- Defined in the cfg.pagetypes table.&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.&lt;br /&gt;
-- &amp;quot;Editing of this page by new or unregistered users is currently disabled&amp;quot;&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the&lt;br /&gt;
-- template.&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONLEVEL} - the protection level, e.g. &amp;quot;fully protected&amp;quot; or&lt;br /&gt;
-- &amp;quot;semi-protected&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,&lt;br /&gt;
-- depending on the protection action.&lt;br /&gt;
--&lt;br /&gt;
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links&lt;br /&gt;
-- straight to that talk page section.&lt;br /&gt;
--&lt;br /&gt;
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to&lt;br /&gt;
-- create a blurb like &amp;quot;This template is semi-protected&amp;quot;, or &amp;quot;This article is&lt;br /&gt;
-- move-protected until DD Month YYYY&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- ${VANDAL} - links for the specified username (or the root page name)&lt;br /&gt;
-- using Module:Vandal-m.&lt;br /&gt;
--&lt;br /&gt;
--                                 Functions&lt;br /&gt;
--&lt;br /&gt;
-- For advanced users, it is possible to use Lua functions instead of strings&lt;br /&gt;
-- in the banner config tables. Using functions gives flexibility that is not&lt;br /&gt;
-- possible just by using parameters. Functions take two arguments, the&lt;br /&gt;
-- protection object and the template arguments, and they must output a string.&lt;br /&gt;
--&lt;br /&gt;
-- For example:&lt;br /&gt;
--&lt;br /&gt;
-- text = function (protectionObj, args)&lt;br /&gt;
--     if protectionObj.level == &#039;autoconfirmed&#039; then&lt;br /&gt;
--         return &#039;foo&#039;&lt;br /&gt;
--     else&lt;br /&gt;
--         return &#039;bar&#039;&lt;br /&gt;
--     end&lt;br /&gt;
-- end&lt;br /&gt;
--&lt;br /&gt;
-- Some protection object properties and methods that may be useful:&lt;br /&gt;
-- protectionObj.action - the protection action&lt;br /&gt;
-- protectionObj.level - the protection level&lt;br /&gt;
-- protectionObj.reason - the protection reason&lt;br /&gt;
-- protectionObj.expiry - the expiry. Nil if unset, the string &amp;quot;indef&amp;quot; if set&lt;br /&gt;
--     to indefinite, and the protection time in unix time if temporary.&lt;br /&gt;
-- protectionObj.protectionDate - the protection date in unix time, or nil if&lt;br /&gt;
--     unspecified.&lt;br /&gt;
-- protectionObj.bannerConfig - the banner config found by the module. Beware&lt;br /&gt;
--     of editing the config field used by the function, as it could create an&lt;br /&gt;
--     infinite loop.&lt;br /&gt;
-- protectionObj:isProtected - returns a boolean showing whether the page is&lt;br /&gt;
--     protected.&lt;br /&gt;
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is&lt;br /&gt;
--     temporary.&lt;br /&gt;
-- protectionObj:isIncorrect - returns a boolean showing whether the protection&lt;br /&gt;
--     template is incorrect.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- The master banner data, used if no values have been found in banners or&lt;br /&gt;
-- defaultBanners.&lt;br /&gt;
masterBanner = {&lt;br /&gt;
	text = &#039;${INTROBLURB}&#039;,&lt;br /&gt;
	explanation = &#039;${EXPLANATIONBLURB}&#039;,&lt;br /&gt;
	tooltip = &#039;${TOOLTIPBLURB}&#039;,&lt;br /&gt;
	link = &#039;${IMAGELINK}&#039;,&lt;br /&gt;
	alt = &#039;页面被${PROTECTIONLEVEL}&#039;&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- The default banner data. This holds banner data for different protection&lt;br /&gt;
-- levels.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
defaultBanners = {&lt;br /&gt;
	edit = {},&lt;br /&gt;
	move = {},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		autoconfirmed = {&lt;br /&gt;
			alt = &#039;Page protected with pending changes level 1&#039;,&lt;br /&gt;
			tooltip = &#039;All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users&#039;,&lt;br /&gt;
			image = &#039;Padlock-silver-light.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		default = {&lt;br /&gt;
			alt = &#039;Page protected with pending changes level 2&#039;,&lt;br /&gt;
			tooltip = &#039;All edits by users who are not reviewers or administrators are&#039;&lt;br /&gt;
				.. &#039; subject to review prior to becoming visible to unregistered users&#039;,&lt;br /&gt;
			image = &#039;Padlock-orange.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	upload = {}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- The banner data. This holds banner data for different protection reasons.&lt;br /&gt;
-- In fact, the reasons specified in this table control which reasons are&lt;br /&gt;
-- valid inputs to the first positional parameter.&lt;br /&gt;
--&lt;br /&gt;
-- There is also a non-standard &amp;quot;description&amp;quot; field that can be used for items&lt;br /&gt;
-- in this table. This is a description of the protection reason for use in the&lt;br /&gt;
-- module documentation.&lt;br /&gt;
--&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
banners = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		blp = {&lt;br /&gt;
			description = &#039;为了遵守&#039;&lt;br /&gt;
				.. &#039; [[Wikipedia:生者傳記&#039;&lt;br /&gt;
				.. &#039;|生者傳記]]方针而保护的页面&#039;,&lt;br /&gt;
			text = &#039;${INTROFRAGMENT}以遵守&#039;&lt;br /&gt;
				.. &#039; [[Wikipedia:生者傳記&#039;&lt;br /&gt;
				.. &amp;quot;|维基百科&amp;quot;&lt;br /&gt;
				.. &#039;生者傳記]]方针。&#039;,&lt;br /&gt;
			tooltip = &#039;${TOOLTIPFRAGMENT}以遵守&#039;&lt;br /&gt;
				.. &#039;生者傳記方针&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		dmca = {&lt;br /&gt;
			description = &#039;因[[數字千年版權法]]移除通知而&#039;&lt;br /&gt;
				.. &#039;被维基媒体基金会保护的页面&#039;,&lt;br /&gt;
			explanation = function (protectionObj, args)&lt;br /&gt;
				local ret = &#039;为回应数字&#039;&lt;br /&gt;
					.. &#039; 千年版权法案（DMCA）下，文中部分内容&#039;&lt;br /&gt;
					.. &#039; 权利人发来的通知，维基媒体基金会已根据&#039;&lt;br /&gt;
					.. &#039; 适用法律采取行动，删除并限制了相关&#039;&lt;br /&gt;
					.. &#039; 内容。&#039;&lt;br /&gt;
				if args.notice then&lt;br /&gt;
					ret = ret .. &#039;可以在此查看删除请求副本：&#039;&lt;br /&gt;
						.. args.notice .. &#039;。&#039;&lt;br /&gt;
				end&lt;br /&gt;
				ret = ret .. &#039;有关更多信息，包括讨论&#039;&lt;br /&gt;
					.. &#039;如何提交反通知的网站，请参阅&#039;&lt;br /&gt;
					.. &#039;[[Wikipedia:基金會行動]]及条目的${TALKPAGE}。&#039;&lt;br /&gt;
					.. &amp;quot;&#039;&#039;&#039;在限制撤销之前，&amp;quot;&lt;br /&gt;
					.. &amp;quot;请勿移除此模板&#039;&#039;&#039;。&amp;quot;&lt;br /&gt;
				return ret&lt;br /&gt;
			end,&lt;br /&gt;
			image = &#039;Office-protection-shackle-WMFlogo.svg&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		dispute = {&lt;br /&gt;
			description = &#039;由于编辑争议而被保护的页面&#039;,&lt;br /&gt;
			text = function (protectionObj, args)&lt;br /&gt;
				-- Find the value of &amp;quot;disputes&amp;quot;.&lt;br /&gt;
				local display = &#039;争议&#039;&lt;br /&gt;
				local disputes&lt;br /&gt;
				if args.section then&lt;br /&gt;
					disputes = string.format(&lt;br /&gt;
						&#039;[[%s:%s#%s|%s]]&#039;,&lt;br /&gt;
						mw.site.namespaces[protectionObj.title.namespace].talk.name,&lt;br /&gt;
						protectionObj.title.text,&lt;br /&gt;
						args.section,&lt;br /&gt;
						display&lt;br /&gt;
					)&lt;br /&gt;
				else&lt;br /&gt;
					disputes = display&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				-- Make the blurb, depending on the expiry.&lt;br /&gt;
				local msg&lt;br /&gt;
				if type(protectionObj.expiry) == &#039;number&#039; then&lt;br /&gt;
					msg = &#039;${INTROFRAGMENT}，或直到编辑%s被解决。&#039;&lt;br /&gt;
				else&lt;br /&gt;
					msg = &#039;${INTROFRAGMENT}，直到编辑%s被解决。&#039;&lt;br /&gt;
				end&lt;br /&gt;
				return string.format(msg, disputes)&lt;br /&gt;
			end,&lt;br /&gt;
			explanation = &amp;quot;此保护&#039;&#039;&#039;不是&#039;&#039;&#039;对&amp;quot;&lt;br /&gt;
				.. &#039;${CURRENTVERSION}的认可。${EXPLANATIONBLURB}&#039;,&lt;br /&gt;
			tooltip = &#039;由于编辑争议，${TOOLTIPFRAGMENT}&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		mainpage = {&lt;br /&gt;
			description = &#039;由于在[[Wikipedia:首页]]展示而被保护的页面&#039;,&lt;br /&gt;
			text = &#039;此文件目前已&#039;&lt;br /&gt;
				.. &#039;获[[Wikipedia:獲保護頁面|保护]]而&#039;&lt;br /&gt;
				.. &#039;无法编辑，因为它当前或即将&#039;&lt;br /&gt;
				.. &#039;在[[Wikipedia:首页]]上展示。&#039;,&lt;br /&gt;
			explanation = &#039;首页上的图像由于其高可见性而被&#039;&lt;br /&gt;
				.. &#039;保护。任何必要的更改请在${TALKPAGE}上讨论。&#039;&lt;br /&gt;
				.. &#039;&amp;lt;br /&amp;gt;&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&lt;br /&gt;
				.. &amp;quot;&#039;&#039;&#039;致管理员：&#039;&#039;&#039;一旦此图像从首页撤下，&amp;quot;&lt;br /&gt;
				.. &#039;请取消保护此文件，或酌情减少到&#039;&lt;br /&gt;
				.. &#039;半保护。&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		office = {&lt;br /&gt;
			description = &#039;被维基媒体基金会保护的页面&#039;,&lt;br /&gt;
			text = function (protectionObj, args)&lt;br /&gt;
				local ret = &#039;此${PAGETYPE}目前正在接受&#039;&lt;br /&gt;
					.. &#039;[[Wikipedia:基金會行動|維基媒體基金會辦公室]]&#039;&lt;br /&gt;
					.. &#039;的审查，&#039;&lt;br /&gt;
					.. &#039;并获保护。&#039;&lt;br /&gt;
				if protectionObj.protectionDate then&lt;br /&gt;
					ret = ret .. &#039;此页面自${PROTECTIONDATE}起被保护。&#039;&lt;br /&gt;
				end&lt;br /&gt;
				return ret&lt;br /&gt;
			end,&lt;br /&gt;
			explanation = &amp;quot;如果您可以编辑此页面，请首先在&amp;quot;&lt;br /&gt;
				.. &amp;quot;${TALKPAGE}上讨论任何修改或添加动作。&#039;&#039;&#039;请勿解除此页面的保护&amp;quot;&lt;br /&gt;
				.. &amp;quot;状态，除非您得到维基媒体基金会&amp;quot;&lt;br /&gt;
				.. &amp;quot;的授权。&#039;&#039;&#039;&amp;quot;,&lt;br /&gt;
			image = &#039;Office-protection-shackle-WMFlogo.svg&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		reset = {&lt;br /&gt;
			description = &#039;被维基媒体基金会保护，并将其&#039;&lt;br /&gt;
				.. &#039;“重置”为纯粹版本的页面&#039;,&lt;br /&gt;
 			text = &#039;此${PAGETYPE}目前正在接受&#039;&lt;br /&gt;
					.. &#039;[[Wikipedia:基金會行動|維基媒體基金會辦公室]]&#039;&lt;br /&gt;
					.. &#039;的审查，&#039;&lt;br /&gt;
					.. &#039;并获保护。&#039;,&lt;br /&gt;
			explanation = function (protectionObj, args)&lt;br /&gt;
				local ret = &#039;&#039;&lt;br /&gt;
				if protectionObj.protectionDate then&lt;br /&gt;
					ret = ret .. &#039;在${PROTECTIONDATE}，此${PAGETYPE}&#039;&lt;br /&gt;
				else&lt;br /&gt;
					ret = ret .. &#039;此${PAGETYPE}已&#039;&lt;br /&gt;
				end&lt;br /&gt;
				ret = ret .. &#039;被简化为&#039;&lt;br /&gt;
				.. &#039;“纯粹”的版本，以便可以完全&#039;&lt;br /&gt;
				.. &#039;重写，确保其符合&#039;&lt;br /&gt;
				.. &#039;[[WP:NPOV|中立的观点]]和[[WP:V|可供查证]]方针。&#039;&lt;br /&gt;
				.. &#039;重写版本最终将会向所有编者开放，&#039;&lt;br /&gt;
				.. &#039;通常的维基百科方针都将适用于此页面，并将严格&#039;&lt;br /&gt;
				.. &#039;执行。此${PAGETYPE}在重建时已被&#039;&lt;br /&gt;
				.. &#039;${PROTECTIONLEVEL}。\n\n&#039;&lt;br /&gt;
				.. &#039;直接添加任何从此${PAGETYPE}&#039;&lt;br /&gt;
				.. &#039;保护前版本中得到的资料，或&#039;&lt;br /&gt;
				.. &#039;任何添加至此${PAGETYPE}中的&#039;&lt;br /&gt;
				.. &#039;无来源资料，都将被删除。相关讨论页也于&#039;&lt;br /&gt;
				.. &#039;同一天清空。\n\n&#039;&lt;br /&gt;
				.. &amp;quot;如果您可以编辑此页面，请首先在&amp;quot;&lt;br /&gt;
				.. &amp;quot;${TALKPAGE}上讨论任何修改或添加动作。&#039;&#039;&#039;请勿覆盖&amp;quot;&lt;br /&gt;
				.. &amp;quot;此操作，且不要解除此页面的保护状态，&amp;quot;&lt;br /&gt;
				.. &amp;quot;除非您已获得维基媒体基金会的&amp;quot;&lt;br /&gt;
				.. &amp;quot;授权。任何编者均不可移除此通知。&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
				return ret&lt;br /&gt;
			end,&lt;br /&gt;
			image = &#039;Office-protection-shackle-WMFlogo.svg&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		sock = {&lt;br /&gt;
			description = &#039;由于滥用&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:傀儡|傀儡]]而被保护的页面。&#039;,&lt;br /&gt;
			text = &#039;${INTROFRAGMENT}，以防止被&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:封禁方针|封禁]]或被&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:編輯禁制方針|編輯禁制]]用户的[[Wikipedia:傀儡|傀儡]]&#039;&lt;br /&gt;
				.. &#039;编辑。&#039;,&lt;br /&gt;
			tooltip = &#039;为防止被封禁或被編輯禁制用户的傀儡编辑，&#039;&lt;br /&gt;
				.. &#039;${TOOLTIPFRAGMENT}&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		template = {&lt;br /&gt;
			description = &#039;[[Wikipedia:高風險模板|高風險模板]]&#039;&lt;br /&gt;
				.. &#039;和Lua模块&#039;,&lt;br /&gt;
			text = &#039;此${PAGETYPE}为[[Wikipedia:高風險模板|高風險模板]]，&#039;&lt;br /&gt;
				.. &#039;已被永久[[Wikipedia:獲保護頁面|保護]]。&#039;,&lt;br /&gt;
			explanation = &#039;请在${TALKPAGE}上讨论任何修改或添加动作。如果&#039;&lt;br /&gt;
				.. &#039;编辑[[Help:小修改#何时标明编辑为小修改&#039;&lt;br /&gt;
				.. &#039;|无争议]]或有&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:共识|共识]]基础，您可以&#039;&lt;br /&gt;
				.. &#039;向[[Wikipedia:管理员|管理员]]或&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:模板编辑员|模板编辑员]]&#039;&lt;br /&gt;
				.. &#039;${EDITREQUEST}。您也可以&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面|请求]]解除&#039;&lt;br /&gt;
				.. &#039;页面保护。&#039;,&lt;br /&gt;
			tooltip = &#039;此高风险${PAGETYPE}已被永久${PROTECTIONLEVEL}&#039;&lt;br /&gt;
				.. &#039;，以避免破坏&#039;,&lt;br /&gt;
			alt = &#039;被永久保护的${PAGETYPE}&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		usertalk = {&lt;br /&gt;
			description = &#039;由于特定用户破坏而&#039;&lt;br /&gt;
				.. &#039;被保护的页面&#039;,&lt;br /&gt;
			text = &#039;${INTROFRAGMENT}，以防止${VANDAL}使用其进行破坏性编辑，&#039;&lt;br /&gt;
				.. &#039;如滥用&#039;&lt;br /&gt;
				.. &#039;&amp;amp;#123;&amp;amp;#123;[[Template:unblock|unblock]]&amp;amp;#125;&amp;amp;#125;模板。&#039;,&lt;br /&gt;
			explanation = &#039;如果您不能编辑此用户讨论页，且需要&#039;&lt;br /&gt;
				.. &#039;修改或留言，您可以&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面&#039;&lt;br /&gt;
				.. &#039;#请求编辑&#039;&lt;br /&gt;
				.. &#039;|请求编辑]]，&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面&#039;&lt;br /&gt;
				.. &#039;#请求解除保护&#039;&lt;br /&gt;
				.. &#039;|请求解除保护]]，&#039;&lt;br /&gt;
				.. &#039;[[Special:用户登录|登录]]，&#039;&lt;br /&gt;
				.. &#039;或[[Special:创建账户|创建帐户]]。&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		vandalism = {&lt;br /&gt;
			description = &#039;由于&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:破坏|破坏]]而被保护的页面&#039;,&lt;br /&gt;
			text = &#039;由于[[Wikipedia:破坏|破坏]]，${INTROFRAGMENT}。&#039;,&lt;br /&gt;
			explanation = function (protectionObj, args)&lt;br /&gt;
				local ret = &#039;&#039;&lt;br /&gt;
				if protectionObj.level == &#039;sysop&#039; then&lt;br /&gt;
					ret = ret .. &amp;quot;此保护&#039;&#039;&#039;不是&#039;&#039;&#039;对&amp;quot;&lt;br /&gt;
						.. &#039;${CURRENTVERSION}的认可。&#039;&lt;br /&gt;
				end&lt;br /&gt;
				return ret .. &#039;${EXPLANATIONBLURB}&#039;&lt;br /&gt;
			end,&lt;br /&gt;
			tooltip = &#039;由于破坏，${TOOLTIPFRAGMENT}&#039;,&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		dispute = {&lt;br /&gt;
			description = &#039;由于标题争议而&#039;&lt;br /&gt;
				.. &#039;被移动保护的页面&#039;,&lt;br /&gt;
			explanation = &amp;quot;此保护&#039;&#039;&#039;不是&#039;&#039;&#039;对&amp;quot;&lt;br /&gt;
				.. &#039;${CURRENTVERSION}的认可。${EXPLANATIONBLURB}&#039;,&lt;br /&gt;
			image = &#039;Move-protection-shackle.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		vandalism = {&lt;br /&gt;
			description = &#039;由于&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:破坏#移动破坏&#039;&lt;br /&gt;
				.. &#039;|移动破坏]]而被保护的页面&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {},&lt;br /&gt;
	upload = {}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                            GENERAL DATA TABLES&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection blurbs&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table produces the protection blurbs available with the&lt;br /&gt;
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and&lt;br /&gt;
-- protection level, and is checked by the module in the following order:&lt;br /&gt;
-- 1. page&#039;s protection action, page&#039;s protection level&lt;br /&gt;
-- 2. page&#039;s protection action, default protection level&lt;br /&gt;
-- 3. &amp;quot;edit&amp;quot; protection action, default protection level&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
protectionBlurbs = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = &#039;此${PAGETYPE}当前已被[[Wikipedia:獲保護頁面|&#039;&lt;br /&gt;
			.. &#039;保護]]，无法编辑&#039;,&lt;br /&gt;
		autoconfirmed = &#039;[[Wikipedia:用户权限&#039;&lt;br /&gt;
			.. &#039;级别#新用户|新用户]]或[[Wikipedia:用户权限级别#匿名&#039;&lt;br /&gt;
			.. &#039;用户|匿名用户]]用户编辑此${PAGETYPE}目前[[Wikipedia:獲保護頁面|已禁用]]&#039;,&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = &#039;此${PAGETYPE}当前已被[[Wikipedia:獲保護頁面|保護]]，&#039;&lt;br /&gt;
			.. &#039;无法[[Help:页面重命名|移动]]&#039;&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		autoconfirmed = &#039;All edits made to this ${PAGETYPE} by&#039;&lt;br /&gt;
			.. &#039; [[Wikipedia:用户权限级别#新用户|新用户]] or&#039;&lt;br /&gt;
			.. &#039; [[Wikipedia:用户权限级别#匿名用户|匿名用户]]&#039;&lt;br /&gt;
			.. &#039; users are currently&#039;&lt;br /&gt;
			.. &#039; [[Wikipedia:Pending changes|subject to review]]&#039;,&lt;br /&gt;
		default = &#039;All edits made to this ${PAGETYPE} by users who are not&#039;&lt;br /&gt;
			.. &#039; [[Wikipedia:Reviewing|reviewers]] or&#039;&lt;br /&gt;
			.. &#039; [[Wikipedia:管理员|管理员]] are currently&#039;&lt;br /&gt;
			.. &#039; [[Wikipedia:Pending changes|subject to review]]&#039;&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = &#039;上传此${PAGETYPE}的新版本目前已禁用&#039;&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Explanation blurbs&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table produces the explanation blurbs available with the&lt;br /&gt;
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,&lt;br /&gt;
-- protection level, and whether the page is a talk page or not. If the page is&lt;br /&gt;
-- a talk page it will have a talk key of &amp;quot;talk&amp;quot;; otherwise it will have a talk&lt;br /&gt;
-- key of &amp;quot;subject&amp;quot;. The table is checked in the following order:&lt;br /&gt;
-- 1. page&#039;s protection action, page&#039;s protection level, page&#039;s talk key&lt;br /&gt;
-- 2. page&#039;s protection action, page&#039;s protection level, default talk key&lt;br /&gt;
-- 3. page&#039;s protection action, default protection level, page&#039;s talk key&lt;br /&gt;
-- 4. page&#039;s protection action, default protection level, default talk key&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
explanationBlurbs = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		autoconfirmed = {&lt;br /&gt;
			subject = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。如果您&#039;&lt;br /&gt;
				.. &#039;不能编辑，且希望修改此${PAGETYPE}，您可以&#039;&lt;br /&gt;
				.. &#039;${EDITREQUEST}，在${TALKPAGE}上讨论更改，&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面&#039;&lt;br /&gt;
				.. &#039;#请求解除保护&#039;&lt;br /&gt;
				.. &#039;|请求解除保护]]，[[Special:用户登录|登录]]，&#039;&lt;br /&gt;
				.. &#039;或[[Special:创建账户|创建帐户]]。&#039;,&lt;br /&gt;
			default = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。如果您&#039;&lt;br /&gt;
				.. &#039;不能编辑，且希望修改此${PAGETYPE}，您可以&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面&#039;&lt;br /&gt;
				.. &#039;#请求解除保护&#039;&lt;br /&gt;
				.. &#039;|请求解除保护]]，[[Special:用户登录|登录]]，&#039;&lt;br /&gt;
				.. &#039;或[[Special:创建账户|创建帐户]]。&#039;,&lt;br /&gt;
		},&lt;br /&gt;
		default = {&lt;br /&gt;
			subject = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039;请在${TALKPAGE}上讨论任何修改动作。如果&#039;&lt;br /&gt;
				.. &#039;编辑[[Help:小修改#何时标明编辑为小修改&#039;&lt;br /&gt;
				.. &#039;|无争议]]或有[[Wikipedia:共识&#039;&lt;br /&gt;
				.. &#039;|共识]]基础，您可以向&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:管理员|管理员]]&#039;&lt;br /&gt;
				.. &#039;${EDITREQUEST}。您也可以[[Wikipedia:请求&#039;&lt;br /&gt;
				.. &#039;保护页面#请求解除保护&#039;&lt;br /&gt;
				.. &#039;|请求]]解除页面保护。&#039;,&lt;br /&gt;
			default = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039;您可以[[Wikipedia:请求&#039;&lt;br /&gt;
				.. &#039;保护页面#请求编辑|请求&#039;&lt;br /&gt;
				.. &#039;编辑]]此页面，或[[Wikipedia:请求&#039;&lt;br /&gt;
				.. &#039;保护页面#请求解除保护&#039;&lt;br /&gt;
				.. &#039;|请求]]解除页面保护。&#039;,&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = {&lt;br /&gt;
			subject = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039;该页面仍可编辑，但在解除保护后&#039;&lt;br /&gt;
				.. &#039;才能移动。请在${TALKPAGE}或[[Wikipedia:移動請求]]&#039;&lt;br /&gt;
				.. &#039;上讨论任何移动建议。您也可以&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面|请求]]解除&#039;&lt;br /&gt;
				.. &#039;页面保护。&#039;,&lt;br /&gt;
			default = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039;该页面仍可编辑，但在解除保护后&#039;&lt;br /&gt;
				.. &#039;才能移动。请在[[Wikipedia:移動請求]]&#039;&lt;br /&gt;
				.. &#039;上讨论任何移动建议。您也可以&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:请求保护页面|请求]]解除&#039;&lt;br /&gt;
				.. &#039;页面保护。&#039;,&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		default = {&lt;br /&gt;
			reviewer = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039; Edits to this ${PAGETYPE} will not be visible to readers&#039;&lt;br /&gt;
				.. &#039; until they are accepted by a reviewer or an administrator.&#039;&lt;br /&gt;
				.. &#039; To avoid the need for your edits to be reviewed, you may&#039;&lt;br /&gt;
				.. &#039; [[Wikipedia:Requests for page protection&#039;&lt;br /&gt;
				.. &#039;#Current requests for reduction in protection level&#039;&lt;br /&gt;
				.. &#039;|request unprotection]]. Experienced editors may also&#039;&lt;br /&gt;
				.. &#039; request the [[Wikipedia:Reviewing|reviewer user right]].&#039;,&lt;br /&gt;
			default = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039; Edits to this ${PAGETYPE} by new and unregistered users&#039;&lt;br /&gt;
				.. &#039; will not be visible to readers until they are accepted by&#039;&lt;br /&gt;
				.. &#039; a reviewer. To avoid the need for your edits to be&#039;&lt;br /&gt;
				.. &#039; reviewed, you may&#039;&lt;br /&gt;
				.. &#039; [[Wikipedia:Requests for page protection&#039;&lt;br /&gt;
				.. &#039;#Current requests for reduction in protection level&#039;&lt;br /&gt;
				.. &#039;|request unprotection]], [[Special:Userlogin|log in]], or&#039;&lt;br /&gt;
				.. &#039; [[Special:UserLogin/signup|create an account]].&#039;&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = {&lt;br /&gt;
			default = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
				.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
				.. &#039;页面可能仍可以编辑，但在解除保护后&#039;&lt;br /&gt;
				.. &#039;才能上传文件的新版本。您可以使用&#039;&lt;br /&gt;
				.. &#039;[[Wikipedia:编辑请求|受保护页面编辑请求]]&#039;&lt;br /&gt;
				.. &#039;来请求上传新版本，或者您&#039;&lt;br /&gt;
				.. &#039;可以[[Wikipedia:请求保护页面|请求]]&#039;&lt;br /&gt;
				.. &#039;解除文件保护。&#039;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection levels&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which&lt;br /&gt;
-- produces a short label for different protection levels. It is sorted by&lt;br /&gt;
-- protection action and protection level, and is checked in the following&lt;br /&gt;
-- order:&lt;br /&gt;
-- 1. page&#039;s protection action, page&#039;s protection level&lt;br /&gt;
-- 2. page&#039;s protection action, default protection level&lt;br /&gt;
-- 3. &amp;quot;edit&amp;quot; protection action, default protection level&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
protectionLevels = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = &#039;全保护&#039;,&lt;br /&gt;
		templateeditor = &#039;模板保护&#039;,&lt;br /&gt;
		extendedconfirmed = &#039;延伸確認保護&#039;,&lt;br /&gt;
		autoconfirmed = &#039;半保护&#039;,&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = &#039;移动保护&#039;&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = &#039;文件保护&#039;&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Images&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table lists different padlock images for each protection action and&lt;br /&gt;
-- protection level. It is used if an image is not specified in any of the&lt;br /&gt;
-- banner data tables, and if the page does not satisfy the conditions for using&lt;br /&gt;
-- the [&#039;image-filename-indef&#039;] image. It is checked in the following order:&lt;br /&gt;
-- 1. page&#039;s protection action, page&#039;s protection level&lt;br /&gt;
-- 2. page&#039;s protection action, default protection level&lt;br /&gt;
images = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = &#039;Full-protection-shackle-block.svg&#039;,&lt;br /&gt;
		templateeditor = &#039;Template-protection-shackle-picture-1.svg&#039;,&lt;br /&gt;
		extendedconfirmed = &#039;Extended-protection-shackle-account-pro-plus.svg&#039;,&lt;br /&gt;
		autoconfirmed = &#039;Semi-protection-shackle.svg&#039;&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = &#039;Move-protection-shackle.svg&#039;,&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		autoconfirmed = &#039;Padlock-silver-light.svg&#039;,&lt;br /&gt;
		default = &#039;Padlock-orange.svg&#039;&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = &#039;Upload-protection-shackle.svg&#039;&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- Pages with a reason specified in this table will show the special &amp;quot;indef&amp;quot;&lt;br /&gt;
-- padlock, defined in the &#039;image-filename-indef&#039; message, if no expiry is set.&lt;br /&gt;
indefImageReasons = {&lt;br /&gt;
	template = true&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Image links&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table provides the data for the ${IMAGELINK} parameter, which gets&lt;br /&gt;
-- the image link for small padlock icons based on the page&#039;s protection action&lt;br /&gt;
-- and protection level. It is checked in the following order:&lt;br /&gt;
-- 1. page&#039;s protection action, page&#039;s protection level&lt;br /&gt;
-- 2. page&#039;s protection action, default protection level&lt;br /&gt;
-- 3. &amp;quot;edit&amp;quot; protection action, default protection level&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
imageLinks = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = &#039;Wikipedia:保護方針#全保护&#039;,&lt;br /&gt;
		templateeditor = &#039;Wikipedia:保護方針#模板保护&#039;,&lt;br /&gt;
		extendedconfirmed = &#039;Wikipedia:保護方針#延伸確認保護&#039;,&lt;br /&gt;
		autoconfirmed = &#039;Wikipedia:保護方針#半保护&#039;&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = &#039;Wikipedia:保護方針#移动保护&#039;&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		autoconfirmed = &#039;Wikipedia:保護方針#pc1&#039;,&lt;br /&gt;
		reviewer = &#039;Wikipedia:保護方針#pc2&#039;&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = &#039;Wikipedia:保護方針#文件保护&#039;&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Padlock indicator names&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table provides the &amp;quot;name&amp;quot; attribute for the &amp;lt;indicator&amp;gt; extension tag&lt;br /&gt;
-- with which small padlock icons are generated. All indicator tags on a page&lt;br /&gt;
-- are displayed in alphabetical order based on this attribute, and with&lt;br /&gt;
-- indicator tags with duplicate names, the last tag on the page wins.&lt;br /&gt;
-- The attribute is chosen based on the protection action; table keys must be a&lt;br /&gt;
-- protection action name or the string &amp;quot;default&amp;quot;.&lt;br /&gt;
padlockIndicatorNames = {&lt;br /&gt;
	autoreview = &#039;pp-autoreview&#039;,&lt;br /&gt;
	default = &#039;pp-default&#039;&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection categories&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- The protection categories are stored in the protectionCategories table.&lt;br /&gt;
-- Keys to this table are made up of the following strings:&lt;br /&gt;
--&lt;br /&gt;
-- 1. the expiry date&lt;br /&gt;
-- 2. the namespace&lt;br /&gt;
-- 3. the protection reason (e.g. &amp;quot;dispute&amp;quot; or &amp;quot;vandalism&amp;quot;)&lt;br /&gt;
-- 4. the protection level (e.g. &amp;quot;sysop&amp;quot; or &amp;quot;autoconfirmed&amp;quot;)&lt;br /&gt;
-- 5. the action (e.g. &amp;quot;edit&amp;quot; or &amp;quot;move&amp;quot;)&lt;br /&gt;
--&lt;br /&gt;
-- When the module looks up a category in the table, first it will will check to&lt;br /&gt;
-- see a key exists that corresponds to all five parameters. For example, a&lt;br /&gt;
-- user page semi-protected from vandalism for two weeks would have the key&lt;br /&gt;
-- &amp;quot;temp-user-vandalism-autoconfirmed-edit&amp;quot;. If no match is found, the module&lt;br /&gt;
-- changes the first part of the key to &amp;quot;all&amp;quot; and checks the table again. It&lt;br /&gt;
-- keeps checking increasingly generic key combinations until it finds the&lt;br /&gt;
-- field, or until it reaches the key &amp;quot;all-all-all-all-all&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- The module uses a binary matrix to determine the order in which to search.&lt;br /&gt;
-- This is best demonstrated by a table. In this table, the &amp;quot;0&amp;quot; values&lt;br /&gt;
-- represent &amp;quot;all&amp;quot;, and the &amp;quot;1&amp;quot; values represent the original data (e.g.&lt;br /&gt;
-- &amp;quot;indef&amp;quot; or &amp;quot;file&amp;quot; or &amp;quot;vandalism&amp;quot;).&lt;br /&gt;
--&lt;br /&gt;
--        expiry    namespace reason   level     action&lt;br /&gt;
-- order&lt;br /&gt;
-- 1      1         1         1        1         1&lt;br /&gt;
-- 2      0         1         1        1         1&lt;br /&gt;
-- 3      1         0         1        1         1&lt;br /&gt;
-- 4      0         0         1        1         1&lt;br /&gt;
-- 5      1         1         0        1         1&lt;br /&gt;
-- 6      0         1         0        1         1&lt;br /&gt;
-- 7      1         0         0        1         1&lt;br /&gt;
-- 8      0         0         0        1         1&lt;br /&gt;
-- 9      1         1         1        0         1&lt;br /&gt;
-- 10     0         1         1        0         1&lt;br /&gt;
-- 11     1         0         1        0         1&lt;br /&gt;
-- 12     0         0         1        0         1&lt;br /&gt;
-- 13     1         1         0        0         1&lt;br /&gt;
-- 14     0         1         0        0         1&lt;br /&gt;
-- 15     1         0         0        0         1&lt;br /&gt;
-- 16     0         0         0        0         1&lt;br /&gt;
-- 17     1         1         1        1         0&lt;br /&gt;
-- 18     0         1         1        1         0&lt;br /&gt;
-- 19     1         0         1        1         0&lt;br /&gt;
-- 20     0         0         1        1         0&lt;br /&gt;
-- 21     1         1         0        1         0&lt;br /&gt;
-- 22     0         1         0        1         0&lt;br /&gt;
-- 23     1         0         0        1         0&lt;br /&gt;
-- 24     0         0         0        1         0&lt;br /&gt;
-- 25     1         1         1        0         0&lt;br /&gt;
-- 26     0         1         1        0         0&lt;br /&gt;
-- 27     1         0         1        0         0&lt;br /&gt;
-- 28     0         0         1        0         0&lt;br /&gt;
-- 29     1         1         0        0         0&lt;br /&gt;
-- 30     0         1         0        0         0&lt;br /&gt;
-- 31     1         0         0        0         0&lt;br /&gt;
-- 32     0         0         0        0         0&lt;br /&gt;
--&lt;br /&gt;
-- In this scheme the action has the highest priority, as it is the last&lt;br /&gt;
-- to change, and the expiry has the least priority, as it changes the most.&lt;br /&gt;
-- The priorities of the expiry, the protection level and the action are&lt;br /&gt;
-- fixed, but the priorities of the reason and the namespace can be swapped&lt;br /&gt;
-- through the use of the cfg.bannerDataNamespaceHasPriority table.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- If the reason specified to the template is listed in this table,&lt;br /&gt;
-- namespace data will take priority over reason data in the protectionCategories&lt;br /&gt;
-- table.&lt;br /&gt;
reasonsWithNamespacePriority = {&lt;br /&gt;
	vandalism = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- The string to use as a namespace key for the protectionCategories table for each&lt;br /&gt;
-- namespace number.&lt;br /&gt;
categoryNamespaceKeys = {&lt;br /&gt;
	[  2] = &#039;user&#039;,&lt;br /&gt;
	[  3] = &#039;user&#039;,&lt;br /&gt;
	[  4] = &#039;project&#039;,&lt;br /&gt;
	[  6] = &#039;file&#039;,&lt;br /&gt;
	[  8] = &#039;mediawiki&#039;,&lt;br /&gt;
	[ 10] = &#039;template&#039;,&lt;br /&gt;
	[ 12] = &#039;project&#039;,&lt;br /&gt;
	[ 14] = &#039;category&#039;,&lt;br /&gt;
	[100] = &#039;portal&#039;,&lt;br /&gt;
	[828] = &#039;module&#039;,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
protectionCategories = {&lt;br /&gt;
	[&#039;all|all|all|all|all&#039;]                  = &#039;被保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|office|all|all&#039;]               = &#039;被基金会保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|reset|all|all&#039;]                = &#039;被基金会保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|dmca|all|all&#039;]                 = &#039;被基金会保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|mainpage|all|all&#039;]             = &#039;被保护的首页文件&#039;,&lt;br /&gt;
	[&#039;all|template|all|all|edit&#039;]            = &#039;被保護的模板&#039;,&lt;br /&gt;
	[&#039;all|all|all|autoconfirmed|edit&#039;]       = &#039;被半保护的页面&#039;,&lt;br /&gt;
	[&#039;indef|all|all|autoconfirmed|edit&#039;]     = &#039;被永久半保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|blp|autoconfirmed|edit&#039;]       = &#039;被永久半保护的生者传记&#039;,&lt;br /&gt;
	[&#039;temp|all|blp|autoconfirmed|edit&#039;]      = &#039;被暂时半保护的生者传记&#039;,&lt;br /&gt;
	[&#039;all|all|dispute|autoconfirmed|edit&#039;]   = &#039;由于争议而被半保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|sock|autoconfirmed|edit&#039;]      = &#039;由于滥用傀儡而被半保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|vandalism|autoconfirmed|edit&#039;] = &#039;避免破坏而被半保护的页面&#039;,&lt;br /&gt;
	[&#039;all|category|all|autoconfirmed|edit&#039;]  = &#039;被半保護的分類&#039;,&lt;br /&gt;
	[&#039;all|file|all|autoconfirmed|edit&#039;]      = &#039;被半保護的圖像&#039;,&lt;br /&gt;
	[&#039;all|portal|all|autoconfirmed|edit&#039;]    = &#039;被半保護的主題&#039;,&lt;br /&gt;
	[&#039;all|project|all|autoconfirmed|edit&#039;]   = &#039;被半保護的專題&#039;,&lt;br /&gt;
	[&#039;all|talk|all|autoconfirmed|edit&#039;]      = &#039;被半保護的討論頁&#039;,&lt;br /&gt;
	[&#039;all|template|all|autoconfirmed|edit&#039;]  = &#039;被半保護的模板&#039;,&lt;br /&gt;
	[&#039;all|user|all|autoconfirmed|edit&#039;]      = &#039;被半保護的用戶頁&#039;,&lt;br /&gt;
	[&#039;all|template|all|templateeditor|edit&#039;] = &#039;被模板保護的模板&#039;,&lt;br /&gt;
	[&#039;all|all|blp|sysop|edit&#039;]               = &#039;被永久保护的生者传记&#039;,&lt;br /&gt;
	[&#039;temp|all|blp|sysop|edit&#039;]              = &#039;被暂时保护的生者传记&#039;,&lt;br /&gt;
	[&#039;all|all|dispute|sysop|edit&#039;]           = &#039;由于争议而被保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|sock|sysop|edit&#039;]              = &#039;由于滥用傀儡而被保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|vandalism|sysop|edit&#039;]         = &#039;避免破坏而被保护的页面&#039;,&lt;br /&gt;
	[&#039;all|category|all|sysop|edit&#039;]          = &#039;被保護的分類&#039;,&lt;br /&gt;
	[&#039;all|file|all|sysop|edit&#039;]              = &#039;被保護的圖像&#039;,&lt;br /&gt;
	[&#039;all|project|all|sysop|edit&#039;]           = &#039;被保護的專題&#039;,&lt;br /&gt;
	[&#039;all|talk|all|sysop|edit&#039;]              = &#039;被保護的討論頁&#039;,&lt;br /&gt;
	[&#039;all|template|all|sysop|edit&#039;]          = &#039;被保護的模板&#039;,&lt;br /&gt;
	[&#039;all|user|all|sysop|edit&#039;]              = &#039;被保護的用戶頁&#039;,&lt;br /&gt;
	[&#039;all|module|all|all|edit&#039;]              = &#039;被保护的模块&#039;,&lt;br /&gt;
	[&#039;all|module|all|templateeditor|edit&#039;]   = &#039;被模板保护的模块&#039;,&lt;br /&gt;
	[&#039;all|module|all|autoconfirmed|edit&#039;]    = &#039;被半保护的模块&#039;,&lt;br /&gt;
	[&#039;all|all|all|sysop|move&#039;]               = &#039;被移動保護的頁面&#039;,&lt;br /&gt;
	[&#039;indef|all|all|sysop|move&#039;]             = &#039;被永久移動保護的頁面&#039;,&lt;br /&gt;
	[&#039;all|all|dispute|sysop|move&#039;]           = &#039;由于争议而被移动保护的页面&#039;,&lt;br /&gt;
	[&#039;all|all|vandalism|sysop|move&#039;]         = &#039;避免破坏而被移动保护的页面&#039;,&lt;br /&gt;
	[&#039;all|portal|all|sysop|move&#039;]            = &#039;被移動保護的主題&#039;,&lt;br /&gt;
	[&#039;all|portal|all|sysop|move&#039;]            = &#039;被移動保護的主題&#039;,&lt;br /&gt;
	[&#039;all|project|all|sysop|move&#039;]           = &#039;被移動保護的專題&#039;,&lt;br /&gt;
	[&#039;all|talk|all|sysop|move&#039;]              = &#039;被移動保護的討論頁&#039;,&lt;br /&gt;
	[&#039;all|template|all|sysop|move&#039;]          = &#039;被移動保護的模板&#039;,&lt;br /&gt;
	[&#039;all|user|all|sysop|move&#039;]              = &#039;被移動保護的用戶頁&#039;,&lt;br /&gt;
	[&#039;all|all|all|autoconfirmed|autoreview&#039;] = &#039;Wikipedia pending changes protected pages&#039;,&lt;br /&gt;
	[&#039;all|all|all|reviewer|autoreview&#039;]      = &#039;Wikipedia pending changes protected pages (level 2)&#039;,&lt;br /&gt;
	[&#039;all|file|all|all|upload&#039;]              = &#039;被文件保护的文件&#039;,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Expiry category config&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table configures the expiry category behaviour for each protection&lt;br /&gt;
-- action.&lt;br /&gt;
-- * If set to true, setting that action will always categorise the page if&lt;br /&gt;
--   an expiry parameter is not set.&lt;br /&gt;
-- * If set to false, setting that action will never categorise the page.&lt;br /&gt;
-- * If set to nil, the module will categorise the page if:&lt;br /&gt;
--   1) an expiry parameter is not set, and&lt;br /&gt;
--   2) a reason is provided, and&lt;br /&gt;
--   3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck&lt;br /&gt;
--      table.&lt;br /&gt;
&lt;br /&gt;
expiryCheckActions = {&lt;br /&gt;
	edit = nil,&lt;br /&gt;
	move = false,&lt;br /&gt;
	autoreview = true,&lt;br /&gt;
	upload = false&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
reasonsWithoutExpiryCheck = {&lt;br /&gt;
	blp = true,&lt;br /&gt;
	template = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Pagetypes&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table produces the page types available with the ${PAGETYPE} parameter.&lt;br /&gt;
-- Keys are namespace numbers, or the string &amp;quot;default&amp;quot; for the default value.&lt;br /&gt;
pagetypes = {&lt;br /&gt;
	[0] = &#039;条目&#039;,&lt;br /&gt;
	[6] = &#039;文件&#039;,&lt;br /&gt;
	[10] = &#039;模板&#039;,&lt;br /&gt;
	[14] = &#039;分类&#039;,&lt;br /&gt;
	[828] = &#039;模块&#039;,&lt;br /&gt;
	default = &#039;页面&#039;&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Strings marking indefinite protection&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table contains values passed to the expiry parameter that mean the page&lt;br /&gt;
-- is protected indefinitely.&lt;br /&gt;
indefStrings = {&lt;br /&gt;
	[&#039;indef&#039;] = true,&lt;br /&gt;
	[&#039;indefinite&#039;] = true,&lt;br /&gt;
	[&#039;indefinitely&#039;] = true,&lt;br /&gt;
	[&#039;infinite&#039;] = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Group hierarchy&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table maps each group to all groups that have a superset of the original&lt;br /&gt;
-- group&#039;s page editing permissions.&lt;br /&gt;
hierarchy = {&lt;br /&gt;
	sysop = {},&lt;br /&gt;
	reviewer = {&#039;sysop&#039;},&lt;br /&gt;
	filemover = {&#039;sysop&#039;},&lt;br /&gt;
	templateeditor = {&#039;sysop&#039;},&lt;br /&gt;
	extendedconfirmed = {&#039;sysop&#039;},&lt;br /&gt;
	autoconfirmed = {&#039;reviewer&#039;, &#039;filemover&#039;, &#039;templateeditor&#039;, &#039;extendedconfirmed&#039;},&lt;br /&gt;
	user = {&#039;autoconfirmed&#039;},&lt;br /&gt;
	[&#039;*&#039;] = {&#039;user&#039;}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Wrapper templates and their default arguments&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table contains wrapper templates used with the module, and their&lt;br /&gt;
-- default arguments. Templates specified in this table should contain the&lt;br /&gt;
-- following invocation, and no other template content:&lt;br /&gt;
--&lt;br /&gt;
-- {{#invoke:Protection banner|main}}&lt;br /&gt;
--&lt;br /&gt;
-- If other content is desired, it can be added between&lt;br /&gt;
-- &amp;lt;noinclude&amp;gt;...&amp;lt;/noinclude&amp;gt; tags.&lt;br /&gt;
--&lt;br /&gt;
-- When a user calls one of these wrapper templates, they will use the&lt;br /&gt;
-- default arguments automatically. However, users can override any of the&lt;br /&gt;
-- arguments.&lt;br /&gt;
--&lt;br /&gt;
-- [[Wikipedia:模板消息/保護模板]]&lt;br /&gt;
wrappers = {&lt;br /&gt;
	[&#039;Template:Pp-protected&#039;]               = {},&lt;br /&gt;
	[&#039;Template:Pp-semi-blp&#039;]                = {&#039;blp&#039;},&lt;br /&gt;
	-- we don&#039;t need Template:Pp-create&lt;br /&gt;
	[&#039;Template:Pp-dispute&#039;]                 = {&#039;dispute&#039;},&lt;br /&gt;
	-- [&#039;Template:Pp-main-page&#039;]               = {&#039;mainpage&#039;},&lt;br /&gt;
	[&#039;Template:Pp-move&#039;]                    = {action = &#039;move&#039;},&lt;br /&gt;
	[&#039;Template:Pp-move-dispute&#039;]            = {&#039;dispute&#039;, action = &#039;move&#039;},&lt;br /&gt;
	-- we don&#039;t need Template:Pp-move-indef&lt;br /&gt;
	[&#039;Template:Pp-move-vandalism&#039;]          = {&#039;vandalism&#039;, action = &#039;move&#039;},&lt;br /&gt;
	[&#039;Template:Pp-office&#039;]                  = {&#039;office&#039;},&lt;br /&gt;
	[&#039;Template:Pp-office-dmca&#039;]             = {&#039;dmca&#039;},&lt;br /&gt;
	[&#039;Template:Pp-pc1&#039;]                     = {action = &#039;autoreview&#039;, small = true},&lt;br /&gt;
	[&#039;Template:Pp-pc2&#039;]                     = {action = &#039;autoreview&#039;, small = true},&lt;br /&gt;
	[&#039;Template:Pp-reset&#039;]                   = {&#039;reset&#039;},&lt;br /&gt;
	[&#039;Template:Pp-semi-indef&#039;]              = {small = true},&lt;br /&gt;
	[&#039;Template:Pp-semi-sock&#039;]               = {&#039;sock&#039;},&lt;br /&gt;
	[&#039;Template:Pp-template&#039;]                = {&#039;template&#039;, small = true},&lt;br /&gt;
	[&#039;Template:Pp-upload&#039;]                  = {action = &#039;upload&#039;},&lt;br /&gt;
	[&#039;Template:Pp-usertalk&#039;]                = {&#039;usertalk&#039;},&lt;br /&gt;
	[&#039;Template:Pp-vandalism&#039;]               = {&#039;vandalism&#039;},&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                                 MESSAGES&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
msg = {&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Intro blurb and intro fragment&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages specify what is produced by the ${INTROBLURB} and&lt;br /&gt;
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the&lt;br /&gt;
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use&lt;br /&gt;
-- intro-blurb-noexpiry or intro-fragment-noexpiry.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
[&#039;intro-blurb-expiry&#039;] = &#039;${PROTECTIONBLURB}至${EXPIRY}。&#039;,&lt;br /&gt;
[&#039;intro-blurb-noexpiry&#039;] = &#039;${PROTECTIONBLURB}。&#039;,&lt;br /&gt;
[&#039;intro-fragment-expiry&#039;] = &#039;${PROTECTIONBLURB}至${EXPIRY}，&#039;,&lt;br /&gt;
[&#039;intro-fragment-noexpiry&#039;] = &#039;${PROTECTIONBLURB}&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Tooltip blurb&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.&lt;br /&gt;
-- If the protection is temporary the tooltip-blurb-expiry message is used, and&lt;br /&gt;
-- if not the tooltip-blurb-noexpiry message is used.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
[&#039;tooltip-blurb-expiry&#039;] = &#039;此${PAGETYPE}已被${PROTECTIONLEVEL}至${EXPIRY}。&#039;,&lt;br /&gt;
[&#039;tooltip-blurb-noexpiry&#039;] = &#039;此${PAGETYPE}已被${PROTECTIONLEVEL}。&#039;,&lt;br /&gt;
[&#039;tooltip-fragment-expiry&#039;] = &#039;此${PAGETYPE}已被${PROTECTIONLEVEL}至${EXPIRY}，&#039;,&lt;br /&gt;
[&#039;tooltip-fragment-noexpiry&#039;] = &#039;此${PAGETYPE}已被${PROTECTIONLEVEL}&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Special explanation blurb&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages&lt;br /&gt;
-- in the MediaWiki namespace.&lt;br /&gt;
-- It is possible to use banner parameters in this message.&lt;br /&gt;
[&#039;explanation-blurb-nounprotect&#039;] = &#039;更多信息，请参见[[Wikipedia:保護方針|&#039;&lt;br /&gt;
	.. &#039;保護方針]]及${PROTECTIONLOG}。&#039;&lt;br /&gt;
	.. &#039;请在${TALKPAGE}上讨论任何修改或添加动作。如果&#039;&lt;br /&gt;
	.. &#039;编辑[[Help:小修改#何时标明编辑为小修改&#039;&lt;br /&gt;
	.. &#039;|无争议]]或有&#039;&lt;br /&gt;
	.. &#039;[[Wikipedia:共识|共识]]基础，您可以&#039;&lt;br /&gt;
	.. &#039;向[[Wikipedia:管理员|管理员]]&#039;&lt;br /&gt;
	.. &#039;${EDITREQUEST}。&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection log display values&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages determine the display values for the protection log link&lt;br /&gt;
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
[&#039;protection-log-display&#039;] = &#039;保护日志&#039;,&lt;br /&gt;
[&#039;pc-log-display&#039;] = &#039;待更改日志&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Current version display values&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages determine the display values for the page history link&lt;br /&gt;
-- or the move log link produced by the ${CURRENTVERSION} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
[&#039;current-version-move-display&#039;] = &#039;当前标题&#039;,&lt;br /&gt;
[&#039;current-version-edit-display&#039;] = &#039;当前版本&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Talk page&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This message determines the display value of the talk page link produced&lt;br /&gt;
-- with the ${TALKPAGE} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in this message.&lt;br /&gt;
[&#039;talk-page-link-display&#039;] = &#039;讨论页&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Edit requests&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This message determines the display value of the edit request link produced&lt;br /&gt;
-- with the ${EDITREQUEST} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in this message.&lt;br /&gt;
[&#039;edit-request-display&#039;] = &#039;提出编辑请求&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Expiry date format&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This is the format for the blurb expiry date. It should be valid input for&lt;br /&gt;
-- the first parameter of the #time parser function.&lt;br /&gt;
[&#039;expiry-date-format&#039;] = &#039;Y F j&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages determine which tracking categories the module outputs.&lt;br /&gt;
[&#039;tracking-category-incorrect&#039;] = &#039;保護狀態與保護標誌不符的頁面‎&#039;,&lt;br /&gt;
[&#039;tracking-category-template&#039;] = &#039;非模板和模块的模板保护页面&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Images&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These are images that are not defined by their protection action and protection level.&lt;br /&gt;
[&#039;image-filename-indef&#039;] = &#039;Full-protection-shackle-block.svg&#039;,&lt;br /&gt;
[&#039;image-filename-default&#039;] = &#039;Transparent.gif&#039;,&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- End messages&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_expiry&amp;diff=492</id>
		<title>模块:Effective protection expiry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_expiry&amp;diff=492"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == &#039;table&#039; and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action == &#039;autoreview&#039; then&lt;br /&gt;
		local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)&lt;br /&gt;
		return stabilitySettings and stabilitySettings.expiry or &#039;unknown&#039;&lt;br /&gt;
	elseif action ~= &#039;edit&#039; and action ~= &#039;move&#039; and action ~= &#039;create&#039; and action ~= &#039;upload&#039; then&lt;br /&gt;
		error( &#039;First parameter must be one of edit, move, create, upload, autoreview&#039;, 2 )&lt;br /&gt;
	end&lt;br /&gt;
	local rawExpiry = mw.getCurrentFrame():callParserFunction(&#039;PROTECTIONEXPIRY&#039;, action, pagename)&lt;br /&gt;
	if rawExpiry == &#039;infinity&#039; then&lt;br /&gt;
		return &#039;infinity&#039;&lt;br /&gt;
	elseif rawExpiry == &#039;&#039; then&lt;br /&gt;
		return &#039;unknown&#039;&lt;br /&gt;
	else&lt;br /&gt;
		local year, month, day, hour, minute, second = rawExpiry:match(&lt;br /&gt;
			&#039;^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$&#039;&lt;br /&gt;
		)&lt;br /&gt;
		if year then&lt;br /&gt;
			return string.format(&lt;br /&gt;
				&#039;%s-%s-%sT%s:%s:%s&#039;,&lt;br /&gt;
				year, month, day, hour, minute, second&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			error(&#039;internal error in Module:Effective protection expiry; malformed expiry timestamp&#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Protection_banner&amp;diff=490</id>
		<title>模块:Protection banner</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Protection_banner&amp;diff=490"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{pp-meta}} and its daughter templates such as&lt;br /&gt;
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.&lt;br /&gt;
&lt;br /&gt;
-- Initialise necessary modules.&lt;br /&gt;
require(&#039;Module:No globals&#039;)&lt;br /&gt;
local makeFileLink = require(&#039;Module:File link&#039;)._main&lt;br /&gt;
local effectiveProtectionLevel = require(&#039;Module:Effective protection level&#039;)._main&lt;br /&gt;
local effectiveProtectionExpiry = require(&#039;Module:Effective protection expiry&#039;)._main&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&lt;br /&gt;
&lt;br /&gt;
-- Lazily initialise modules and objects we don&#039;t always need.&lt;br /&gt;
local getArgs, makeMessageBox, lang&lt;br /&gt;
&lt;br /&gt;
-- Set constants.&lt;br /&gt;
local CONFIG_MODULE = &#039;Module:Protection banner/config&#039;&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	if cat then&lt;br /&gt;
		return string.format(&lt;br /&gt;
			&#039;[[%s:%s|%s]]&#039;,&lt;br /&gt;
			mw.site.namespaces[14].name,&lt;br /&gt;
			cat,&lt;br /&gt;
			sort&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validation function for the expiry and the protection date&lt;br /&gt;
local function validateDate(dateString, dateType)&lt;br /&gt;
	if not lang then&lt;br /&gt;
		lang = mw.language.getContentLanguage()&lt;br /&gt;
	end&lt;br /&gt;
	local success, result = pcall(lang.formatDate, lang, &#039;U&#039;, dateString)&lt;br /&gt;
	if success then&lt;br /&gt;
		result = tonumber(result)&lt;br /&gt;
		if result then&lt;br /&gt;
			return result&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	error(string.format(&lt;br /&gt;
		&#039;%s「%s」並非有效的格式！&#039;,&lt;br /&gt;
		dateType,&lt;br /&gt;
		tostring(dateString)&lt;br /&gt;
	), 4)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeFullUrl(page, query, display)&lt;br /&gt;
	return require(&#039;Module:Fullurl&#039;)._fullurl2(page, query, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Given a directed graph formatted as node -&amp;gt; table of direct successors,&lt;br /&gt;
-- get a table of all nodes reachable from a given node (though always&lt;br /&gt;
-- including the given node).&lt;br /&gt;
local function getReachableNodes(graph, start)&lt;br /&gt;
	local toWalk, retval = {[start] = true}, {}&lt;br /&gt;
	while true do&lt;br /&gt;
		-- Can&#039;t use pairs() since we&#039;re adding and removing things as we&#039;re iterating&lt;br /&gt;
		local k = next(toWalk) -- This always gets the &amp;quot;first&amp;quot; key&lt;br /&gt;
		if k == nil then&lt;br /&gt;
			return retval&lt;br /&gt;
		end&lt;br /&gt;
		toWalk[k] = nil&lt;br /&gt;
		retval[k] = true&lt;br /&gt;
		for _,v in ipairs(graph[k]) do&lt;br /&gt;
			if not retval[v] then&lt;br /&gt;
				toWalk[v] = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Protection = {}&lt;br /&gt;
Protection.__index = Protection&lt;br /&gt;
&lt;br /&gt;
Protection.supportedActions = {&lt;br /&gt;
	edit = true,&lt;br /&gt;
	move = true,&lt;br /&gt;
	autoreview = true,&lt;br /&gt;
	upload = true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Protection.bannerConfigFields = {&lt;br /&gt;
	&#039;text&#039;,&lt;br /&gt;
	&#039;explanation&#039;,&lt;br /&gt;
	&#039;tooltip&#039;,&lt;br /&gt;
	&#039;alt&#039;,&lt;br /&gt;
	&#039;link&#039;,&lt;br /&gt;
	&#039;image&#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function Protection.new(args, cfg, title)&lt;br /&gt;
	local obj = {}&lt;br /&gt;
	obj._cfg = cfg&lt;br /&gt;
	obj.title = title or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Set action&lt;br /&gt;
	if not args.action then&lt;br /&gt;
		obj.action = &#039;edit&#039;&lt;br /&gt;
	elseif Protection.supportedActions[args.action] then&lt;br /&gt;
		obj.action = args.action&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&#039;未知動作「%s」&#039;,&lt;br /&gt;
			tostring(args.action)&lt;br /&gt;
		), 3)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set level&lt;br /&gt;
	obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)&lt;br /&gt;
	if not obj.level or (obj.action == &#039;move&#039; and obj.level == &#039;autoconfirmed&#039;) then&lt;br /&gt;
		-- Users need to be autoconfirmed to move pages anyway, so treat&lt;br /&gt;
		-- semi-move-protected pages as unprotected.&lt;br /&gt;
		obj.level = &#039;*&#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set expiry&lt;br /&gt;
	local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)&lt;br /&gt;
	if effectiveExpiry == &#039;infinity&#039; then&lt;br /&gt;
		obj.expiry = &#039;indef&#039;&lt;br /&gt;
	elseif effectiveExpiry ~= &#039;unknown&#039; then&lt;br /&gt;
		obj.expiry = validateDate(effectiveExpiry, &#039;截止時間&#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set reason&lt;br /&gt;
	if args[1] then&lt;br /&gt;
		obj.reason = mw.ustring.lower(args[1])&lt;br /&gt;
		if obj.reason:find(&#039;|&#039;) then&lt;br /&gt;
			error(&#039;理由中不得存在「|」！&#039;, 3)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set protection date&lt;br /&gt;
	if args.date then&lt;br /&gt;
		obj.protectionDate = validateDate(args.date, &#039;保護日期&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Set banner config&lt;br /&gt;
	do&lt;br /&gt;
		obj.bannerConfig = {}&lt;br /&gt;
		local configTables = {}&lt;br /&gt;
		if cfg.banners[obj.action] then&lt;br /&gt;
			configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]&lt;br /&gt;
		end&lt;br /&gt;
		if cfg.defaultBanners[obj.action] then&lt;br /&gt;
			configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]&lt;br /&gt;
			configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default&lt;br /&gt;
		end&lt;br /&gt;
		configTables[#configTables + 1] = cfg.masterBanner&lt;br /&gt;
		for i, field in ipairs(Protection.bannerConfigFields) do&lt;br /&gt;
			for j, t in ipairs(configTables) do&lt;br /&gt;
				if t[field] then&lt;br /&gt;
					obj.bannerConfig[field] = t[field]&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return setmetatable(obj, Protection)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isProtected()&lt;br /&gt;
	return self.level ~= &#039;*&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isTemporary()&lt;br /&gt;
	return type(self.expiry) == &#039;number&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:makeProtectionCategory()&lt;br /&gt;
	local cfg = self._cfg&lt;br /&gt;
	local title = self.title&lt;br /&gt;
	&lt;br /&gt;
	-- Exit if the page is not protected.&lt;br /&gt;
	if not self:isProtected() then&lt;br /&gt;
		return &#039;&#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get the expiry key fragment.&lt;br /&gt;
	local expiryFragment&lt;br /&gt;
	if self.expiry == &#039;indef&#039; then&lt;br /&gt;
		expiryFragment = self.expiry&lt;br /&gt;
	elseif type(self.expiry) == &#039;number&#039; then&lt;br /&gt;
		expiryFragment = &#039;temp&#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get the namespace key fragment.&lt;br /&gt;
	local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]&lt;br /&gt;
	if not namespaceFragment and title.namespace % 2 == 1 then&lt;br /&gt;
			namespaceFragment = &#039;talk&#039;&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	-- Define the order that key fragments are tested in. This is done with an&lt;br /&gt;
	-- array of tables containing the value to be tested, along with its&lt;br /&gt;
	-- position in the cfg.protectionCategories table.&lt;br /&gt;
	local order = {&lt;br /&gt;
		{val = expiryFragment,    keypos = 1},&lt;br /&gt;
		{val = namespaceFragment, keypos = 2},&lt;br /&gt;
		{val = self.reason,       keypos = 3},&lt;br /&gt;
		{val = self.level,        keypos = 4},&lt;br /&gt;
		{val = self.action,       keypos = 5}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- The old protection templates used an ad-hoc protection category system,&lt;br /&gt;
	-- with some templates prioritising namespaces in their categories, and&lt;br /&gt;
	-- others prioritising the protection reason. To emulate this in this module&lt;br /&gt;
	-- we use the config table cfg.reasonsWithNamespacePriority to set the&lt;br /&gt;
	-- reasons for which namespaces have priority over protection reason.&lt;br /&gt;
	-- If we are dealing with one of those reasons, move the namespace table to&lt;br /&gt;
	-- the end of the order table, i.e. give it highest priority. If not, the&lt;br /&gt;
	-- reason should have highest priority, so move that to the end of the table&lt;br /&gt;
	-- instead.&lt;br /&gt;
	--]]&lt;br /&gt;
	table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))&lt;br /&gt;
 &lt;br /&gt;
	--[[&lt;br /&gt;
	-- Define the attempt order. Inactive subtables (subtables with nil &amp;quot;value&amp;quot;&lt;br /&gt;
	-- fields) are moved to the end, where they will later be given the key&lt;br /&gt;
	-- &amp;quot;all&amp;quot;. This is to cut down on the number of table lookups in&lt;br /&gt;
	-- cfg.protectionCategories, which grows exponentially with the number of&lt;br /&gt;
	-- non-nil keys. We keep track of the number of active subtables with the&lt;br /&gt;
	-- noActive parameter.&lt;br /&gt;
	--]]&lt;br /&gt;
	local noActive, attemptOrder&lt;br /&gt;
	do&lt;br /&gt;
		local active, inactive = {}, {}&lt;br /&gt;
		for i, t in ipairs(order) do&lt;br /&gt;
			if t.val then&lt;br /&gt;
				active[#active + 1] = t&lt;br /&gt;
			else&lt;br /&gt;
				inactive[#inactive + 1] = t&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		noActive = #active&lt;br /&gt;
		attemptOrder = active&lt;br /&gt;
		for i, t in ipairs(inactive) do&lt;br /&gt;
			attemptOrder[#attemptOrder + 1] = t&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check increasingly generic key combinations until we find a match. If a&lt;br /&gt;
	-- specific category exists for the combination of key fragments we are&lt;br /&gt;
	-- given, that match will be found first. If not, we keep trying different&lt;br /&gt;
	-- key fragment combinations until we match using the key&lt;br /&gt;
	-- &amp;quot;all-all-all-all-all&amp;quot;.&lt;br /&gt;
	--&lt;br /&gt;
	-- To generate the keys, we index the key subtables using a binary matrix&lt;br /&gt;
	-- with indexes i and j. j is only calculated up to the number of active&lt;br /&gt;
	-- subtables. For example, if there were three active subtables, the matrix&lt;br /&gt;
	-- would look like this, with 0 corresponding to the key fragment &amp;quot;all&amp;quot;, and&lt;br /&gt;
	-- 1 corresponding to other key fragments.&lt;br /&gt;
	-- &lt;br /&gt;
	--   j 1  2  3&lt;br /&gt;
	-- i  &lt;br /&gt;
	-- 1   1  1  1&lt;br /&gt;
	-- 2   0  1  1&lt;br /&gt;
	-- 3   1  0  1&lt;br /&gt;
	-- 4   0  0  1&lt;br /&gt;
	-- 5   1  1  0&lt;br /&gt;
	-- 6   0  1  0&lt;br /&gt;
	-- 7   1  0  0&lt;br /&gt;
	-- 8   0  0  0&lt;br /&gt;
	-- &lt;br /&gt;
	-- Values of j higher than the number of active subtables are set&lt;br /&gt;
	-- to the string &amp;quot;all&amp;quot;.&lt;br /&gt;
	--&lt;br /&gt;
	-- A key for cfg.protectionCategories is constructed for each value of i.&lt;br /&gt;
	-- The position of the value in the key is determined by the keypos field in&lt;br /&gt;
	-- each subtable.&lt;br /&gt;
	--]]&lt;br /&gt;
	local cats = cfg.protectionCategories&lt;br /&gt;
	for i = 1, 2^noActive do&lt;br /&gt;
		local key = {}&lt;br /&gt;
		for j, t in ipairs(attemptOrder) do&lt;br /&gt;
			if j &amp;gt; noActive then&lt;br /&gt;
				key[t.keypos] = &#039;all&#039;&lt;br /&gt;
			else&lt;br /&gt;
				local quotient = i / 2 ^ (j - 1)&lt;br /&gt;
				quotient = math.ceil(quotient)&lt;br /&gt;
				if quotient % 2 == 1 then&lt;br /&gt;
					key[t.keypos] = t.val&lt;br /&gt;
				else&lt;br /&gt;
					key[t.keypos] = &#039;all&#039;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		key = table.concat(key, &#039;|&#039;)&lt;br /&gt;
		local attempt = cats[key]&lt;br /&gt;
		if attempt then&lt;br /&gt;
			return makeCategoryLink(attempt, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isIncorrect()&lt;br /&gt;
	local expiry = self.expiry&lt;br /&gt;
	return not self:isProtected()&lt;br /&gt;
		or type(expiry) == &#039;number&#039; and expiry &amp;lt; os.time()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isTemplateProtectedNonTemplate()&lt;br /&gt;
	local action, namespace = self.action, self.title.namespace&lt;br /&gt;
	return self.level == &#039;templateeditor&#039;&lt;br /&gt;
		and (&lt;br /&gt;
			(action ~= &#039;edit&#039; and action ~= &#039;move&#039;)&lt;br /&gt;
			or (namespace ~= 10 and namespace ~= 828)&lt;br /&gt;
		)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:makeCategoryLinks()&lt;br /&gt;
	local msg = self._cfg.msg&lt;br /&gt;
	local ret = { self:makeProtectionCategory() }&lt;br /&gt;
	if self:isIncorrect() then&lt;br /&gt;
		ret[#ret + 1] = makeCategoryLink(&lt;br /&gt;
			msg[&#039;tracking-category-incorrect&#039;],&lt;br /&gt;
			self.title.text&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	if self:isTemplateProtectedNonTemplate() then&lt;br /&gt;
		ret[#ret + 1] = makeCategoryLink(&lt;br /&gt;
			msg[&#039;tracking-category-template&#039;],&lt;br /&gt;
			self.title.text&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Blurb class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Blurb = {}&lt;br /&gt;
Blurb.__index = Blurb&lt;br /&gt;
&lt;br /&gt;
Blurb.bannerTextFields = {&lt;br /&gt;
	text = true,&lt;br /&gt;
	explanation = true,&lt;br /&gt;
	tooltip = true,&lt;br /&gt;
	alt = true,&lt;br /&gt;
	link = true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function Blurb.new(protectionObj, args, cfg)&lt;br /&gt;
	return setmetatable({&lt;br /&gt;
		_cfg = cfg,&lt;br /&gt;
		_protectionObj = protectionObj,&lt;br /&gt;
		_args = args&lt;br /&gt;
	}, Blurb)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Private methods --&lt;br /&gt;
&lt;br /&gt;
function Blurb:_formatDate(num)&lt;br /&gt;
	-- Formats a Unix timestamp into dd Month, YYYY format.&lt;br /&gt;
	lang = lang or mw.language.getContentLanguage()&lt;br /&gt;
	local success, date = pcall(&lt;br /&gt;
		lang.formatDate,&lt;br /&gt;
		lang,&lt;br /&gt;
		self._cfg.msg[&#039;expiry-date-format&#039;] or &#039;j F Y&#039;,&lt;br /&gt;
		&#039;@&#039; .. tostring(num)&lt;br /&gt;
	)&lt;br /&gt;
	if success then&lt;br /&gt;
		return date&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_getExpandedMessage(msgKey)&lt;br /&gt;
	return self:_substituteParameters(self._cfg.msg[msgKey])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_substituteParameters(msg)&lt;br /&gt;
	if not self._params then&lt;br /&gt;
		local parameterFuncs = {}&lt;br /&gt;
&lt;br /&gt;
		parameterFuncs.CURRENTVERSION     = self._makeCurrentVersionParameter&lt;br /&gt;
		parameterFuncs.EDITREQUEST        = self._makeEditRequestParameter&lt;br /&gt;
		parameterFuncs.EXPIRY             = self._makeExpiryParameter&lt;br /&gt;
		parameterFuncs.EXPLANATIONBLURB   = self._makeExplanationBlurbParameter&lt;br /&gt;
		parameterFuncs.IMAGELINK          = self._makeImageLinkParameter&lt;br /&gt;
		parameterFuncs.INTROBLURB         = self._makeIntroBlurbParameter&lt;br /&gt;
		parameterFuncs.INTROFRAGMENT      = self._makeIntroFragmentParameter&lt;br /&gt;
		parameterFuncs.PAGETYPE           = self._makePagetypeParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONBLURB    = self._makeProtectionBlurbParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONDATE     = self._makeProtectionDateParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONLEVEL    = self._makeProtectionLevelParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONLOG      = self._makeProtectionLogParameter&lt;br /&gt;
		parameterFuncs.TALKPAGE           = self._makeTalkPageParameter&lt;br /&gt;
		parameterFuncs.TOOLTIPBLURB       = self._makeTooltipBlurbParameter&lt;br /&gt;
		parameterFuncs.TOOLTIPFRAGMENT    = self._makeTooltipFragmentParameter&lt;br /&gt;
		parameterFuncs.VANDAL             = self._makeVandalTemplateParameter&lt;br /&gt;
		&lt;br /&gt;
		self._params = setmetatable({}, {&lt;br /&gt;
			__index = function (t, k)&lt;br /&gt;
				local param&lt;br /&gt;
				if parameterFuncs[k] then&lt;br /&gt;
					param = parameterFuncs[k](self)&lt;br /&gt;
				end&lt;br /&gt;
				param = param or &#039;&#039;&lt;br /&gt;
				t[k] = param&lt;br /&gt;
				return param&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	msg = msg:gsub(&#039;${(%u+)}&#039;, self._params)&lt;br /&gt;
	return msg&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeCurrentVersionParameter()&lt;br /&gt;
	-- A link to the page history or the move log, depending on the kind of&lt;br /&gt;
	-- protection.&lt;br /&gt;
	local pagename = self._protectionObj.title.prefixedText&lt;br /&gt;
	if self._protectionObj.action == &#039;move&#039; then&lt;br /&gt;
		-- We need the move log link.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			&#039;Special:Log&#039;,&lt;br /&gt;
			{type = &#039;move&#039;, page = pagename},&lt;br /&gt;
			self:_getExpandedMessage(&#039;current-version-move-display&#039;)&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		-- We need the history link.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			pagename,&lt;br /&gt;
			{action = &#039;history&#039;},&lt;br /&gt;
			self:_getExpandedMessage(&#039;current-version-edit-display&#039;)&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeEditRequestParameter()&lt;br /&gt;
	local mEditRequest = require(&#039;Module:Submit an edit request&#039;)&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	&lt;br /&gt;
	-- Get the edit request type.&lt;br /&gt;
	local requestType&lt;br /&gt;
	if action == &#039;edit&#039; then&lt;br /&gt;
		if level == &#039;autoconfirmed&#039; then&lt;br /&gt;
			requestType = &#039;semi&#039;&lt;br /&gt;
		elseif level == &#039;extendedconfirmed&#039; then&lt;br /&gt;
			requestType = &#039;extended&#039;&lt;br /&gt;
		elseif level == &#039;templateeditor&#039; then&lt;br /&gt;
			requestType = &#039;template&#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	requestType = requestType or &#039;full&#039;&lt;br /&gt;
	&lt;br /&gt;
	-- Get the display value.&lt;br /&gt;
	local display = self:_getExpandedMessage(&#039;edit-request-display&#039;)&lt;br /&gt;
&lt;br /&gt;
	return mEditRequest._link{type = requestType, display = display}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeExpiryParameter()&lt;br /&gt;
	local expiry = self._protectionObj.expiry&lt;br /&gt;
	if type(expiry) == &#039;number&#039; then&lt;br /&gt;
		return self:_formatDate(expiry)&lt;br /&gt;
	else&lt;br /&gt;
		return expiry&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeExplanationBlurbParameter()&lt;br /&gt;
	-- Cover special cases first.&lt;br /&gt;
	if self._protectionObj.title.namespace == 8 then&lt;br /&gt;
		-- MediaWiki namespace&lt;br /&gt;
		return self:_getExpandedMessage(&#039;explanation-blurb-nounprotect&#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get explanation blurb table keys&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local talkKey = self._protectionObj.title.isTalkPage and &#039;talk&#039; or &#039;subject&#039;&lt;br /&gt;
&lt;br /&gt;
	-- Find the message in the explanation blurb table and substitute any&lt;br /&gt;
	-- parameters.&lt;br /&gt;
	local explanations = self._cfg.explanationBlurbs&lt;br /&gt;
	local msg&lt;br /&gt;
	if explanations[action][level] and explanations[action][level][talkKey] then&lt;br /&gt;
		msg = explanations[action][level][talkKey]&lt;br /&gt;
	elseif explanations[action][level] and explanations[action][level].default then&lt;br /&gt;
		msg = explanations[action][level].default&lt;br /&gt;
	elseif explanations[action].default and explanations[action].default[talkKey] then&lt;br /&gt;
		msg = explanations[action].default[talkKey]&lt;br /&gt;
	elseif explanations[action].default and explanations[action].default.default then&lt;br /&gt;
		msg = explanations[action].default.default&lt;br /&gt;
	else&lt;br /&gt;
		istalk = talkKey == &#039;talk&#039; and true or false&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&#039;找不到 action=%s protectionlevel=%s istalkpage=%s 時的解釋說明&#039;,&lt;br /&gt;
			action,&lt;br /&gt;
			level,&lt;br /&gt;
			istalk&lt;br /&gt;
		), 8)&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeImageLinkParameter()&lt;br /&gt;
	local imageLinks = self._cfg.imageLinks&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local msg&lt;br /&gt;
	if imageLinks[action][level] then&lt;br /&gt;
		msg = imageLinks[action][level]&lt;br /&gt;
	elseif imageLinks[action].default then&lt;br /&gt;
		msg = imageLinks[action].default&lt;br /&gt;
	else&lt;br /&gt;
		msg = imageLinks.edit.default&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeIntroBlurbParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage(&#039;intro-blurb-expiry&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage(&#039;intro-blurb-noexpiry&#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeIntroFragmentParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage(&#039;intro-fragment-expiry&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage(&#039;intro-fragment-noexpiry&#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makePagetypeParameter()&lt;br /&gt;
	local pagetypes = self._cfg.pagetypes&lt;br /&gt;
	return pagetypes[self._protectionObj.title.namespace]&lt;br /&gt;
		or pagetypes.default&lt;br /&gt;
		or error(&#039;「pagetypes.default」丟失！&#039;, 8)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionBlurbParameter()&lt;br /&gt;
	local protectionBlurbs = self._cfg.protectionBlurbs&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local msg&lt;br /&gt;
	if protectionBlurbs[action][level] then&lt;br /&gt;
		msg = protectionBlurbs[action][level]&lt;br /&gt;
	elseif protectionBlurbs[action].default then&lt;br /&gt;
		msg = protectionBlurbs[action].default&lt;br /&gt;
	elseif protectionBlurbs.edit.default then&lt;br /&gt;
		msg = protectionBlurbs.edit.default&lt;br /&gt;
	else&lt;br /&gt;
		error(&#039;沒有為「protectionBlurbs.edit.default」定義保護說明！&#039;, 8)&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionDateParameter()&lt;br /&gt;
	local protectionDate = self._protectionObj.protectionDate&lt;br /&gt;
	if type(protectionDate) == &#039;number&#039; then&lt;br /&gt;
		return self:_formatDate(protectionDate)&lt;br /&gt;
	else&lt;br /&gt;
		return protectionDate&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionLevelParameter()&lt;br /&gt;
	local protectionLevels = self._cfg.protectionLevels&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local msg&lt;br /&gt;
	if protectionLevels[action][level] then&lt;br /&gt;
		msg = protectionLevels[action][level]&lt;br /&gt;
	elseif protectionLevels[action].default then&lt;br /&gt;
		msg = protectionLevels[action].default&lt;br /&gt;
	elseif protectionLevels.edit.default then&lt;br /&gt;
		msg = protectionLevels.edit.default&lt;br /&gt;
	else&lt;br /&gt;
		error(&#039;沒有為「protectionLevels.edit.default」定義保護級別！&#039;, 8)&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionLogParameter()&lt;br /&gt;
	local pagename = self._protectionObj.title.prefixedText&lt;br /&gt;
	if self._protectionObj.action == &#039;autoreview&#039; then&lt;br /&gt;
		-- We need the pending changes log.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			&#039;Special:Log&#039;,&lt;br /&gt;
			{type = &#039;stable&#039;, page = pagename},&lt;br /&gt;
			self:_getExpandedMessage(&#039;pc-log-display&#039;)&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		-- We need the protection log.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			&#039;Special:Log&#039;,&lt;br /&gt;
			{type = &#039;protect&#039;, page = pagename},&lt;br /&gt;
			self:_getExpandedMessage(&#039;protection-log-display&#039;)&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeTalkPageParameter()&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&#039;[[%s:%s#%s|%s]]&#039;,&lt;br /&gt;
		mw.site.namespaces[self._protectionObj.title.namespace].talk.name,&lt;br /&gt;
		self._protectionObj.title.text,&lt;br /&gt;
		self._args.section or &#039;top&#039;,&lt;br /&gt;
		self:_getExpandedMessage(&#039;talk-page-link-display&#039;)&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeTooltipBlurbParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage(&#039;tooltip-blurb-expiry&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage(&#039;tooltip-blurb-noexpiry&#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeTooltipFragmentParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage(&#039;tooltip-fragment-expiry&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage(&#039;tooltip-fragment-noexpiry&#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeVandalTemplateParameter()&lt;br /&gt;
	return require(&#039;Module:Vandal-m&#039;)._main{&lt;br /&gt;
		self._args.user or self._protectionObj.title.baseText&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Public methods --&lt;br /&gt;
&lt;br /&gt;
function Blurb:makeBannerText(key)&lt;br /&gt;
	-- Validate input.&lt;br /&gt;
	if not key or not Blurb.bannerTextFields[key] then&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&#039;「%s」不是有效的橫幅配置金鑰。&#039;,&lt;br /&gt;
			tostring(key)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Generate the text.&lt;br /&gt;
	local msg = self._protectionObj.bannerConfig[key]&lt;br /&gt;
	if type(msg) == &#039;string&#039; then&lt;br /&gt;
		return self:_substituteParameters(msg)&lt;br /&gt;
	elseif type(msg) == &#039;function&#039; then&lt;br /&gt;
		msg = msg(self._protectionObj, self._args)&lt;br /&gt;
		if type(msg) ~= &#039;string&#039; then&lt;br /&gt;
			error(string.format(&lt;br /&gt;
				&#039;解析橫幅配置時生成錯誤「%s」&#039;,&lt;br /&gt;
				tostring(key),&lt;br /&gt;
				type(msg)&lt;br /&gt;
			), 4)&lt;br /&gt;
		end&lt;br /&gt;
		return self:_substituteParameters(msg)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- BannerTemplate class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local BannerTemplate = {}&lt;br /&gt;
BannerTemplate.__index = BannerTemplate&lt;br /&gt;
&lt;br /&gt;
function BannerTemplate.new(protectionObj, cfg)&lt;br /&gt;
	local obj = {}&lt;br /&gt;
	obj._cfg = cfg&lt;br /&gt;
&lt;br /&gt;
	-- Set the image filename.&lt;br /&gt;
	local imageFilename = protectionObj.bannerConfig.image&lt;br /&gt;
	if imageFilename then&lt;br /&gt;
		obj._imageFilename = imageFilename&lt;br /&gt;
	else&lt;br /&gt;
		-- If an image filename isn&#039;t specified explicitly in the banner config,&lt;br /&gt;
		-- generate it from the protection status and the namespace.&lt;br /&gt;
		local action = protectionObj.action&lt;br /&gt;
		local level = protectionObj.level&lt;br /&gt;
		local namespace = protectionObj.title.namespace&lt;br /&gt;
		local reason = protectionObj.reason&lt;br /&gt;
		&lt;br /&gt;
		-- Deal with special cases first.&lt;br /&gt;
		if (&lt;br /&gt;
			namespace == 10&lt;br /&gt;
			or namespace == 828&lt;br /&gt;
			or reason and obj._cfg.indefImageReasons[reason]&lt;br /&gt;
			)&lt;br /&gt;
			and action == &#039;edit&#039;&lt;br /&gt;
			and level == &#039;sysop&#039;&lt;br /&gt;
			and not protectionObj:isTemporary()&lt;br /&gt;
		then&lt;br /&gt;
			-- Fully protected modules and templates get the special red &amp;quot;indef&amp;quot;&lt;br /&gt;
			-- padlock.&lt;br /&gt;
			obj._imageFilename = obj._cfg.msg[&#039;image-filename-indef&#039;]&lt;br /&gt;
		else&lt;br /&gt;
			-- Deal with regular protection types.&lt;br /&gt;
			local images = obj._cfg.images&lt;br /&gt;
			if images[action] then&lt;br /&gt;
				if images[action][level] then&lt;br /&gt;
					obj._imageFilename = images[action][level]&lt;br /&gt;
				elseif images[action].default then&lt;br /&gt;
					obj._imageFilename = images[action].default&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return setmetatable(obj, BannerTemplate)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function BannerTemplate:renderImage()&lt;br /&gt;
	local filename = self._imageFilename&lt;br /&gt;
		or self._cfg.msg[&#039;image-filename-default&#039;]&lt;br /&gt;
		or &#039;Transparent.gif&#039;&lt;br /&gt;
	return makeFileLink{&lt;br /&gt;
		file = filename,&lt;br /&gt;
		size = (self.imageWidth or 20) .. &#039;px&#039;,&lt;br /&gt;
		alt = self._imageAlt,&lt;br /&gt;
		link = self._imageLink,&lt;br /&gt;
		caption = self.imageCaption&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Banner class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Banner = setmetatable({}, BannerTemplate)&lt;br /&gt;
Banner.__index = Banner&lt;br /&gt;
&lt;br /&gt;
function Banner.new(protectionObj, blurbObj, cfg)&lt;br /&gt;
	local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn&#039;t need the blurb.&lt;br /&gt;
	obj.imageWidth = 40&lt;br /&gt;
	obj.imageCaption = blurbObj:makeBannerText(&#039;alt&#039;) -- Large banners use the alt text for the tooltip.&lt;br /&gt;
	obj._reasonText = blurbObj:makeBannerText(&#039;text&#039;)&lt;br /&gt;
	obj._explanationText = blurbObj:makeBannerText(&#039;explanation&#039;)&lt;br /&gt;
	obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.&lt;br /&gt;
	return setmetatable(obj, Banner)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Banner:__tostring()&lt;br /&gt;
	-- Renders the banner.&lt;br /&gt;
	makeMessageBox = makeMessageBox or require(&#039;Module:Message box&#039;).main&lt;br /&gt;
	local reasonText = self._reasonText or error(&#039;沒有理由！&#039;, 2)&lt;br /&gt;
	local explanationText = self._explanationText&lt;br /&gt;
	local mbargs = {&lt;br /&gt;
		page = self._page,&lt;br /&gt;
		type = &#039;protection&#039;,&lt;br /&gt;
		image = self:renderImage(),&lt;br /&gt;
		text = string.format(&lt;br /&gt;
			&amp;quot;&#039;&#039;&#039;%s&#039;&#039;&#039;%s&amp;quot;,&lt;br /&gt;
			reasonText,&lt;br /&gt;
			explanationText and &#039;&amp;lt;br /&amp;gt;&#039; .. explanationText or &#039;&#039;&lt;br /&gt;
		)&lt;br /&gt;
	}&lt;br /&gt;
	return makeMessageBox(&#039;mbox&#039;, mbargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Padlock class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Padlock = setmetatable({}, BannerTemplate)&lt;br /&gt;
Padlock.__index = Padlock&lt;br /&gt;
&lt;br /&gt;
function Padlock.new(protectionObj, blurbObj, cfg)&lt;br /&gt;
	local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn&#039;t need the blurb.&lt;br /&gt;
	obj.imageWidth = 20&lt;br /&gt;
	obj.imageCaption = blurbObj:makeBannerText(&#039;tooltip&#039;)&lt;br /&gt;
	obj._imageAlt = blurbObj:makeBannerText(&#039;alt&#039;)&lt;br /&gt;
	obj._imageLink = blurbObj:makeBannerText(&#039;link&#039;)&lt;br /&gt;
	obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]&lt;br /&gt;
		or cfg.padlockIndicatorNames.default&lt;br /&gt;
		or &#039;pp-default&#039;&lt;br /&gt;
	return setmetatable(obj, Padlock)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Padlock:__tostring()&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	-- The nowiki tag helps prevent whitespace at the top of articles.&lt;br /&gt;
	return frame:extensionTag{name = &#039;nowiki&#039;} .. frame:extensionTag{&lt;br /&gt;
		name = &#039;indicator&#039;,&lt;br /&gt;
		args = {name = self._indicatorName},&lt;br /&gt;
		content = self:renderImage()&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._exportClasses()&lt;br /&gt;
	-- This is used for testing purposes.&lt;br /&gt;
	return {&lt;br /&gt;
		Protection = Protection,&lt;br /&gt;
		Blurb = Blurb,&lt;br /&gt;
		BannerTemplate = BannerTemplate,&lt;br /&gt;
		Banner = Banner,&lt;br /&gt;
		Padlock = Padlock,&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, cfg, title)&lt;br /&gt;
	args = args or {}&lt;br /&gt;
	cfg = cfg or require(CONFIG_MODULE)&lt;br /&gt;
&lt;br /&gt;
	local protectionObj = Protection.new(args, cfg, title)&lt;br /&gt;
&lt;br /&gt;
	local ret = {}&lt;br /&gt;
&lt;br /&gt;
	-- If a page&#039;s edit protection is equally or more restrictive than its&lt;br /&gt;
	-- protection from some other action, then don&#039;t bother displaying anything&lt;br /&gt;
	-- for the other action (except categories).&lt;br /&gt;
	if protectionObj.action == &#039;edit&#039; or&lt;br /&gt;
		args.demolevel or&lt;br /&gt;
		not getReachableNodes(&lt;br /&gt;
			cfg.hierarchy,&lt;br /&gt;
			protectionObj.level&lt;br /&gt;
		)[effectiveProtectionLevel(&#039;edit&#039;, protectionObj.title)]&lt;br /&gt;
	then&lt;br /&gt;
		-- Initialise the blurb object&lt;br /&gt;
		local blurbObj = Blurb.new(protectionObj, args, cfg)&lt;br /&gt;
	&lt;br /&gt;
		-- Render the banner&lt;br /&gt;
		if protectionObj:isProtected() then&lt;br /&gt;
			ret[#ret + 1] = tostring(&lt;br /&gt;
				(yesno(args.small) and Padlock or Banner)&lt;br /&gt;
				.new(protectionObj, blurbObj, cfg)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Render the categories&lt;br /&gt;
	if yesno(args.category) ~= false then&lt;br /&gt;
		ret[#ret + 1] = protectionObj:makeCategoryLinks()&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(ret)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame, cfg)&lt;br /&gt;
	cfg = cfg or require(CONFIG_MODULE)&lt;br /&gt;
&lt;br /&gt;
	-- Find default args, if any.&lt;br /&gt;
	local parent = frame.getParent and frame:getParent()&lt;br /&gt;
	local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub(&#039;/sandbox$&#039;, &#039;&#039;)]&lt;br /&gt;
&lt;br /&gt;
	-- Find user args, and use the parent frame if we are being called from a&lt;br /&gt;
	-- wrapper template.&lt;br /&gt;
	getArgs = getArgs or require(&#039;Module:Arguments&#039;).getArgs&lt;br /&gt;
	local userArgs = getArgs(frame, {&lt;br /&gt;
		parentOnly = defaultArgs,&lt;br /&gt;
		frameOnly = not defaultArgs&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	-- Build the args table. User-specified args overwrite default args.&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(defaultArgs or {}) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	for k, v in pairs(userArgs) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args, cfg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Sandbox_other&amp;diff=488</id>
		<title>模板:Sandbox other</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Sandbox_other&amp;diff=488"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#if:{{#ifeq:{{SUBPAGENAME}}|sandbox|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Documentation_subpage&amp;diff=486</id>
		<title>模板:Documentation subpage</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Documentation_subpage&amp;diff=486"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#if:{{{Original-recipe|{{{Orig|}}}}}}&lt;br /&gt;
| &amp;lt;!--&lt;br /&gt;
--&amp;gt;{{Mbox&amp;lt;!--&lt;br /&gt;
--&amp;gt;| type = content&amp;lt;!--&lt;br /&gt;
--&amp;gt;| image = [[File:Edit-copy green.svg|40px|alt=|link=]]&amp;lt;!--&lt;br /&gt;
--&amp;gt;| text = &amp;lt;!--&lt;br /&gt;
----&amp;gt;此頁面是[[{{NAMESPACE}}:{{{1|{{BASEPAGENAME}}}}}]]的[[Wikipedia:模板文件頁模式|{{NSPN}}]]。&amp;lt;!--&lt;br /&gt;
----&amp;gt;&amp;lt;small&amp;gt;&amp;lt;!--&lt;br /&gt;
------&amp;gt;此頁面可能不打算被直接閱讀。&amp;lt;!--&lt;br /&gt;
------&amp;gt;&amp;lt;br&amp;gt;&amp;lt;!--&lt;br /&gt;
------&amp;gt;使用[[Help:魔术字#变量|變量]]的-{zh-hans:链接;zh-hant:連結;}-可能看起來已損壞，事實上，這是有用途的連結，因此請勿將其替換為[[寫死]]的頁面名稱或URL。&amp;lt;!--&lt;br /&gt;
----&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{inhib|{{{inhibit|x}}}}}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;| &amp;lt;!--&lt;br /&gt;
--&amp;gt;| [[Category:模板說明文件|{{PAGENAME}}]]&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&lt;br /&gt;
| &amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#switch:{{SUBPAGENAME}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;| {{{override}}}| doc | Doc | documentation | Documentation | 文档 | 文件 = &amp;lt;!--&lt;br /&gt;
----&amp;gt;{{#ifeq:{{{doc-notice|show}}}&amp;lt;!--&lt;br /&gt;
----&amp;gt;| show&amp;lt;!--&lt;br /&gt;
----&amp;gt;| &amp;lt;!--&lt;br /&gt;
------&amp;gt;{{Mbox&amp;lt;!--&lt;br /&gt;
------&amp;gt;| type = notice&amp;lt;!--&lt;br /&gt;
------&amp;gt;| image = [[File:Edit-copy green.svg|40px|alt=|link=]]&amp;lt;!--&lt;br /&gt;
------&amp;gt;| text = &amp;lt;!--&lt;br /&gt;
--------&amp;gt;&#039;&#039;&#039;此頁面是[[{{NAMESPACE}}:{{{1|{{BASEPAGENAME}}}}}]]的[[Wikipedia:模板文件頁模式|{{NSPN}}]]。&#039;&#039;&#039;&amp;lt;!--&lt;br /&gt;
--------&amp;gt;&amp;lt;br&amp;gt;&amp;lt;!--&lt;br /&gt;
--------&amp;gt;&amp;lt;small&amp;gt;此頁面可能包含了模板的使用說明、[[Wikipedia:頁面分類|分類]]和其他内容。&amp;lt;/small&amp;gt;&amp;lt;!--&lt;br /&gt;
------&amp;gt;}}&amp;lt;!--&lt;br /&gt;
----&amp;gt;}}&amp;lt;!--&lt;br /&gt;
----&amp;gt;{{DEFAULTSORT:{{PAGENAME}}}}&amp;lt;!--&lt;br /&gt;
----&amp;gt;{{#if:{{{inhibit|}}}&amp;lt;!--&lt;br /&gt;
----&amp;gt;| &amp;lt;!--&lt;br /&gt;
----&amp;gt;| [[Category:{{#switch:{{NAMESPACE}}|User=用户|Wikipedia=维基百科|Template=模板}}说明文件]]&amp;lt;!--&lt;br /&gt;
----&amp;gt;}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories and interwikis to the /doc subpage, not here! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:File_link&amp;diff=484</id>
		<title>模块:File link</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:File_link&amp;diff=484"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides a library for formatting file wikilinks.&lt;br /&gt;
&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&lt;br /&gt;
local checkType = require(&#039;libraryUtil&#039;).checkType&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	checkType(&#039;_main&#039;, 1, args, &#039;table&#039;)&lt;br /&gt;
&lt;br /&gt;
	-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our&lt;br /&gt;
	-- own function to get the right error level.&lt;br /&gt;
	local function checkArg(key, val, level)&lt;br /&gt;
		if type(val) ~= &#039;string&#039; then&lt;br /&gt;
			error(string.format(&lt;br /&gt;
				&amp;quot;type error in &#039;%s&#039; parameter of &#039;_main&#039; (expected string, got %s)&amp;quot;,&lt;br /&gt;
				key, type(val)&lt;br /&gt;
			), level)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = {}&lt;br /&gt;
&lt;br /&gt;
	-- Adds a positional parameter to the buffer.&lt;br /&gt;
	local function addPositional(key)&lt;br /&gt;
		local val = args[key]&lt;br /&gt;
		if not val then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		checkArg(key, val, 4)&lt;br /&gt;
		ret[#ret + 1] = val&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Adds a named parameter to the buffer. We assume that the parameter name&lt;br /&gt;
	-- is the same as the argument key.&lt;br /&gt;
	local function addNamed(key)&lt;br /&gt;
		local val = args[key]&lt;br /&gt;
		if not val then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		checkArg(key, val, 4)&lt;br /&gt;
		ret[#ret + 1] = key .. &#039;=&#039; .. val&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Filename&lt;br /&gt;
	checkArg(&#039;file&#039;, args.file, 3)&lt;br /&gt;
	ret[#ret + 1] = &#039;File:&#039; .. args.file&lt;br /&gt;
&lt;br /&gt;
	-- Format&lt;br /&gt;
	if args.format then&lt;br /&gt;
		checkArg(&#039;format&#039;, args.format)&lt;br /&gt;
		if args.formatfile then&lt;br /&gt;
			checkArg(&#039;formatfile&#039;, args.formatfile)&lt;br /&gt;
			ret[#ret + 1] = args.format .. &#039;=&#039; .. args.formatfile&lt;br /&gt;
		else&lt;br /&gt;
			ret[#ret + 1] = args.format&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Border&lt;br /&gt;
	if yesno(args.border) then&lt;br /&gt;
		ret[#ret + 1] = &#039;border&#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	addPositional(&#039;location&#039;)&lt;br /&gt;
	addPositional(&#039;alignment&#039;)&lt;br /&gt;
	addPositional(&#039;size&#039;)&lt;br /&gt;
	addNamed(&#039;upright&#039;)&lt;br /&gt;
	addNamed(&#039;link&#039;)&lt;br /&gt;
	addNamed(&#039;alt&#039;)&lt;br /&gt;
	addNamed(&#039;page&#039;)&lt;br /&gt;
	addNamed(&#039;class&#039;)&lt;br /&gt;
	addNamed(&#039;lang&#039;)&lt;br /&gt;
	addNamed(&#039;start&#039;)&lt;br /&gt;
	addNamed(&#039;end&#039;)&lt;br /&gt;
	addNamed(&#039;thumbtime&#039;)&lt;br /&gt;
	addPositional(&#039;caption&#039;)&lt;br /&gt;
&lt;br /&gt;
	return string.format(&#039;[[%s]]&#039;, table.concat(ret, &#039;|&#039;))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local origArgs = require(&#039;Module:Arguments&#039;).getArgs(frame, {&lt;br /&gt;
		wrappers = &#039;Template:File link&#039;&lt;br /&gt;
	})&lt;br /&gt;
	if not origArgs.file then&lt;br /&gt;
		error(&amp;quot;&#039;file&#039; parameter missing from [[Template:File link]]&amp;quot;, 0)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Copy the arguments that were passed to a new table to avoid looking up&lt;br /&gt;
	-- every possible parameter in the frame object.&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		-- Make _BLANK a special argument to add a blank parameter. For use in&lt;br /&gt;
		-- conditional templates etc. it is useful for blank arguments to be&lt;br /&gt;
		-- ignored, but we still need a way to specify them so that we can do&lt;br /&gt;
		-- things like [[File:Example.png|link=]].&lt;br /&gt;
		if v == &#039;_BLANK&#039; then&lt;br /&gt;
			v = &#039;&#039;&lt;br /&gt;
		end&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Documentation/config&amp;diff=482</id>
		<title>模块:Documentation/config</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Documentation/config&amp;diff=482"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;----------------------------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                               Configuration for Module:Documentation&lt;br /&gt;
--&lt;br /&gt;
-- Here you can set the values of the parameters and messages used in Module:Documentation to&lt;br /&gt;
-- localise it to your wiki and your language. Unless specified otherwise, values given here&lt;br /&gt;
-- should be string values.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Do not edit this line.&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Protection template configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;protection-reason-edit&#039;]&lt;br /&gt;
-- The protection reason for edit-protected templates to pass to&lt;br /&gt;
-- [[Module:Protection banner]].&lt;br /&gt;
cfg[&#039;protection-reason-edit&#039;] = &#039;template&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox notice configuration&lt;br /&gt;
--&lt;br /&gt;
-- On sandbox pages the module can display a template notifying users that the current page is a&lt;br /&gt;
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a&lt;br /&gt;
-- sandbox or not based on the value of cfg[&#039;sandbox-subpage&#039;]. The following settings configure the&lt;br /&gt;
-- messages that the notices contains.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-notice-image&#039;]&lt;br /&gt;
-- The image displayed in the sandbox notice.&lt;br /&gt;
cfg[&#039;sandbox-notice-image&#039;] = &#039;[[File:Sandbox.svg|50px|alt=|link=]]&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-template&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-module&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-other&#039;]&lt;br /&gt;
-- The page type of the sandbox page. The message that is displayed depends on the current subject&lt;br /&gt;
-- namespace. This message is used in either cfg[&#039;sandbox-notice-blurb&#039;] or&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-blurb&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-template&#039;] = &#039;[[Wikipedia:模板的沙盒和测试样例|沙盒]]&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-module&#039;] = &#039;[[Wikipedia:模板的沙盒和测试样例|沙盒]]&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-other&#039;] = &#039;沙盒&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-display&#039;]&lt;br /&gt;
-- Either cfg[&#039;sandbox-notice-blurb&#039;] or cfg[&#039;sandbox-notice-diff-blurb&#039;] is the opening sentence&lt;br /&gt;
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page&lt;br /&gt;
-- type, which is either cfg[&#039;sandbox-notice-pagetype-template&#039;],&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-module&#039;] or cfg[&#039;sandbox-notice-pagetype-other&#039;] depending what&lt;br /&gt;
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between&lt;br /&gt;
-- the sandbox and the main template. The display value of the diff link is set by &lt;br /&gt;
-- cfg[&#039;sandbox-notice-compare-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-blurb&#039;] = &#039;这是$2的$1。&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-diff-blurb&#039;] = &#039;这是$2（$3）的$1。&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-compare-link-display&#039;] = &#039;差异&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-link-display&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-link-display&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-blurb&#039;] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-link-display&#039;] is the display value for that link.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-blurb&#039;] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test&lt;br /&gt;
-- cases page, and $2 is a link to the page to run it.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-link-display&#039;] is the display value for the link to run the test&lt;br /&gt;
-- cases.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-blurb&#039;] = &#039;参见本$1的$2。&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-link-display&#039;] = &#039;测试样例&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-run-blurb&#039;] = &#039;参见本$1的$2（$3）。&#039;&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-run-link-display&#039;] = &#039;-{zh-cn:运行; zh-tw:執行;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-category&#039;] - A category to add to all template sandboxes.&lt;br /&gt;
-- cfg[&#039;module-sandbox-category&#039;] - A category to add to all module sandboxes.&lt;br /&gt;
-- cfg[&#039;module-sandbox-category&#039;] - A category to add to all sandboxe not in templates or modules.&lt;br /&gt;
cfg[&#039;sandbox-category&#039;] = &#039;模板沙盒&#039;&lt;br /&gt;
cfg[&#039;module-sandbox-category&#039;] = &#039;模块沙盒&#039;&lt;br /&gt;
cfg[&#039;other-sandbox-category&#039;] = &#039;模板或模块命名空间之外的沙盒&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Start box configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;documentation-icon-wikitext&#039;]&lt;br /&gt;
-- The wikitext for the icon shown at the top of the template.&lt;br /&gt;
cfg[&#039;documentation-icon-wikitext&#039;] = &#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the template namespace.&lt;br /&gt;
cfg[&#039;template-namespace-heading&#039;] = &#039;模板-{zh-cn:文档; zh-tw:文件;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the module namespace.&lt;br /&gt;
cfg[&#039;module-namespace-heading&#039;] = &#039;-{zh-hans:模块;zh-hant:模組}--{zh-cn:文档; zh-tw:文件;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;file-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the file namespace.&lt;br /&gt;
cfg[&#039;file-namespace-heading&#039;] = &#039;摘要&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;other-namespaces-heading&#039;]&lt;br /&gt;
-- The heading shown in other namespaces.&lt;br /&gt;
cfg[&#039;other-namespaces-heading&#039;] = &#039;-{zh-cn:文档; zh-tw:文件;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;view-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;view&amp;quot; links.&lt;br /&gt;
cfg[&#039;view-link-display&#039;] = &#039;-{zh-cn:查看;zh-tw:檢視}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;edit-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;edit-link-display&#039;] = &#039;编辑&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;history-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;history&amp;quot; links.&lt;br /&gt;
cfg[&#039;history-link-display&#039;] = &#039;历史&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;purge-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;purge&amp;quot; links.&lt;br /&gt;
cfg[&#039;purge-link-display&#039;] = &#039;清除-{zh-hans:缓存;zh-hant:快取}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;create-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;create-link-display&#039;] = &#039;-{zh-cn:创建; zh-tw:建立;}-&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Link box (end box) configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;transcluded-from-blurb&#039;]&lt;br /&gt;
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.&lt;br /&gt;
cfg[&#039;transcluded-from-blurb&#039;] = &#039;上述[[Wikipedia:模板文檔頁模式|-{zh-cn:文档; zh-tw:文件;}-]][[Wikipedia:嵌入包含|嵌入]]自$1。&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;create-module-doc-blurb&#039;]&lt;br /&gt;
-- Notice displayed in the module namespace when the documentation subpage does not exist.&lt;br /&gt;
-- $1 is a link to create the documentation page with the preload cfg[&#039;module-preload&#039;] and the&lt;br /&gt;
-- display cfg[&#039;create-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;create-module-doc-blurb&#039;] = &#039;您可能想要$1本[[Wikipedia:Lua|Scribunto-{zh-hans:模块;zh-hant:模組}-]]的-{zh-cn:文档; zh-tw:文件;}-。&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Experiment blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;experiment-blurb-template&#039;]&lt;br /&gt;
-- cfg[&#039;experiment-blurb-module&#039;]&lt;br /&gt;
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.&lt;br /&gt;
-- It is only shown in the template and module namespaces. With the default English settings, it&lt;br /&gt;
-- might look like this:&lt;br /&gt;
--&lt;br /&gt;
-- Editors can experiment in this template&#039;s sandbox (edit | diff) and testcases (edit) pages.&lt;br /&gt;
--&lt;br /&gt;
-- In this example, &amp;quot;sandbox&amp;quot;, &amp;quot;edit&amp;quot;, &amp;quot;diff&amp;quot;, &amp;quot;testcases&amp;quot;, and &amp;quot;edit&amp;quot; would all be links.&lt;br /&gt;
--&lt;br /&gt;
-- There are two versions, cfg[&#039;experiment-blurb-template&#039;] and cfg[&#039;experiment-blurb-module&#039;], depending&lt;br /&gt;
-- on what namespace we are in.&lt;br /&gt;
-- &lt;br /&gt;
-- Parameters:&lt;br /&gt;
--&lt;br /&gt;
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;sandbox-link-display&#039;] (cfg[&#039;sandbox-edit-link-display&#039;] | cfg[&#039;compare-link-display&#039;])&lt;br /&gt;
-- &lt;br /&gt;
-- If the sandbox doesn&#039;t exist, it is in the format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;sandbox-link-display&#039;] (cfg[&#039;sandbox-create-link-display&#039;] | cfg[&#039;mirror-link-display&#039;])&lt;br /&gt;
-- &lt;br /&gt;
-- The link for cfg[&#039;sandbox-create-link-display&#039;] link preloads the page with cfg[&#039;template-sandbox-preload&#039;]&lt;br /&gt;
-- or cfg[&#039;module-sandbox-preload&#039;], depending on the current namespace. The link for cfg[&#039;mirror-link-display&#039;]&lt;br /&gt;
-- loads a default edit summary of cfg[&#039;mirror-edit-summary&#039;].&lt;br /&gt;
--&lt;br /&gt;
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;testcases-link-display&#039;] (cfg[&#039;testcases-edit-link-display&#039;] | cfg[&#039;testcases-run-link-display&#039;])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn&#039;t exist, it is in the format:&lt;br /&gt;
-- &lt;br /&gt;
--     cfg[&#039;testcases-link-display&#039;] (cfg[&#039;testcases-create-link-display&#039;])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn&#039;t exist, the link for cfg[&#039;testcases-create-link-display&#039;] preloads the&lt;br /&gt;
-- page with cfg[&#039;template-testcases-preload&#039;] or cfg[&#039;module-testcases-preload&#039;], depending on the current&lt;br /&gt;
-- namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;experiment-blurb-template&#039;] = &amp;quot;编者可以在本模板的$1和$2页面进行实验。&amp;quot;&lt;br /&gt;
cfg[&#039;experiment-blurb-module&#039;] = &amp;quot;编者可以在本-{zh-cn:模块; zh-tw:模組}-的$1和$2页面进行实验。&amp;quot;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage typically used for sandboxes.&lt;br /&gt;
cfg[&#039;sandbox-subpage&#039;] = &#039;sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-sandbox-preload&#039;]&lt;br /&gt;
-- Preload file for template sandbox pages.&lt;br /&gt;
cfg[&#039;template-sandbox-preload&#039;] = &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-sandbox-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module sandbox pages.&lt;br /&gt;
cfg[&#039;module-sandbox-preload&#039;] = &#039;Template:Documentation/preload-module-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;sandbox&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-link-display&#039;] = &#039;沙盒&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-edit-link-display&#039;]&lt;br /&gt;
-- The text to display for sandbox &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-edit-link-display&#039;] = &#039;编辑&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-create-link-display&#039;]&lt;br /&gt;
-- The text to display for sandbox &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-create-link-display&#039;] = &#039;-{zh-cn:创建; zh-tw:建立;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;compare-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;compare&amp;quot; links.&lt;br /&gt;
cfg[&#039;compare-link-display&#039;] = &#039;差异&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-edit-summary&#039;]&lt;br /&gt;
-- The default edit summary to use when a user clicks the &amp;quot;mirror&amp;quot; link. $1 is a wikilink to the&lt;br /&gt;
-- template page.&lt;br /&gt;
cfg[&#039;mirror-edit-summary&#039;] = &#039;建立$1的沙盒版本&#039; -- 本訊息無法使用轉換&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;mirror&amp;quot; links.&lt;br /&gt;
cfg[&#039;mirror-link-display&#039;] = &#039;镜像&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-link-preload&#039;]&lt;br /&gt;
-- The page to preload when a user clicks the &amp;quot;mirror&amp;quot; link.&lt;br /&gt;
cfg[&#039;mirror-link-preload&#039;] = &#039;Template:Documentation/mirror&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Test cases link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage typically used for test cases.&lt;br /&gt;
cfg[&#039;testcases-subpage&#039;] = &#039;testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-testcases-preload&#039;]&lt;br /&gt;
-- Preload file for template test cases pages.&lt;br /&gt;
cfg[&#039;template-testcases-preload&#039;] = &#039;Template:Documentation/preload-testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-testcases-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module test cases pages.&lt;br /&gt;
cfg[&#039;module-testcases-preload&#039;] = &#039;Template:Documentation/preload-module-testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;testcases&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-link-display&#039;] = &#039;测试样例&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-edit-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-edit-link-display&#039;] = &#039;编辑&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-run-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;run&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-run-link-display&#039;] = &#039;-{zh-cn:运行; zh-tw:執行;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-create-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-create-link-display&#039;] = &#039;-{zh-cn:创建; zh-tw:建立;}-&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Add categories blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;add-categories-blurb&#039;]&lt;br /&gt;
-- Text to direct users to add categories to the /doc subpage. Not used if the &amp;quot;content&amp;quot; or&lt;br /&gt;
-- &amp;quot;docname fed&amp;quot; arguments are set, as then it is not clear where to add the categories. $1 is a&lt;br /&gt;
-- link to the /doc subpage with a display value of cfg[&#039;doc-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;add-categories-blurb&#039;] = &#039;请在$1子页面中添加分类。&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;doc-link-display&#039;]&lt;br /&gt;
-- The text to display when linking to the /doc subpage.&lt;br /&gt;
cfg[&#039;doc-link-display&#039;] = &#039;/doc&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Subpages link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;subpages-blurb&#039;]&lt;br /&gt;
-- The &amp;quot;Subpages of this template&amp;quot; blurb. $1 is a link to the main template&#039;s subpages with a&lt;br /&gt;
-- display value of cfg[&#039;subpages-link-display&#039;]. In the English version this blurb is simply&lt;br /&gt;
-- the link followed by a period, and the link display provides the actual text.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;subpages-blurb&#039;] = &#039;$1。&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;subpages-link-display&#039;]&lt;br /&gt;
-- The text to display for the &amp;quot;subpages of this page&amp;quot; link. $1 is cfg[&#039;template-pagetype&#039;],&lt;br /&gt;
-- cfg[&#039;module-pagetype&#039;] or cfg[&#039;default-pagetype&#039;], depending on whether the current page is in&lt;br /&gt;
-- the template namespace, the module namespace, or another namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;subpages-link-display&#039;] = &#039;本$1的子页面&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for template pages.&lt;br /&gt;
cfg[&#039;template-pagetype&#039;] = &#039;模板&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for Lua module pages.&lt;br /&gt;
cfg[&#039;module-pagetype&#039;] = &#039;-{zh-cn:模块; zh-tw:模組;}-&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;default-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for pages other than templates or Lua modules.&lt;br /&gt;
cfg[&#039;default-pagetype&#039;] = &#039;页&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Doc link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;doc-subpage&#039;]&lt;br /&gt;
-- The name of the subpage typically used for documentation pages.&lt;br /&gt;
cfg[&#039;doc-subpage&#039;] = &#039;doc&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;docpage-preload&#039;]&lt;br /&gt;
-- Preload file for template documentation pages in all namespaces.&lt;br /&gt;
cfg[&#039;docpage-preload&#039;] = &#039;Template:Documentation/preload&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module documentation pages.&lt;br /&gt;
cfg[&#039;module-preload&#039;] = &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- HTML and CSS configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;templatestyles&#039;]&lt;br /&gt;
-- The name of the TemplateStyles page where CSS is kept.&lt;br /&gt;
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.&lt;br /&gt;
cfg[&#039;templatestyles&#039;] = &#039;Module:Documentation/styles.css&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;container&#039;]&lt;br /&gt;
-- Class which can be used to set flex or grid CSS on the&lt;br /&gt;
-- two child divs documentation and documentation-metadata&lt;br /&gt;
cfg[&#039;container&#039;] = &#039;documentation-container&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;main-div-classes&#039;]&lt;br /&gt;
-- Classes added to the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg[&#039;main-div-classes&#039;] = &#039;documentation&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;main-div-heading-class&#039;]&lt;br /&gt;
-- Class for the main heading for templates and modules and assoc. talk spaces&lt;br /&gt;
cfg[&#039;main-div-heading-class&#039;] = &#039;documentation-heading&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;start-box-class&#039;]&lt;br /&gt;
-- Class for the start box&lt;br /&gt;
cfg[&#039;start-box-class&#039;] = &#039;documentation-startbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;start-box-link-classes&#039;]&lt;br /&gt;
-- Classes used for the [view][edit][history] or [create] links in the start box.&lt;br /&gt;
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]&lt;br /&gt;
cfg[&#039;start-box-link-classes&#039;] = &#039;mw-editsection-like plainlinks&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;end-box-class&#039;]&lt;br /&gt;
-- Class for the end box.&lt;br /&gt;
cfg[&#039;end-box-class&#039;] = &#039;documentation-metadata&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;end-box-plainlinks&#039;]&lt;br /&gt;
-- Plainlinks&lt;br /&gt;
cfg[&#039;end-box-plainlinks&#039;] = &#039;plainlinks&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;toolbar-class&#039;]&lt;br /&gt;
-- Class added for toolbar links.&lt;br /&gt;
cfg[&#039;toolbar-class&#039;] = &#039;documentation-toolbar&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;clear&#039;]&lt;br /&gt;
-- Just used to clear things.&lt;br /&gt;
cfg[&#039;clear&#039;] = &#039;documentation-clear&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking category configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;display-strange-usage-category&#039;]&lt;br /&gt;
-- Set to true to enable output of cfg[&#039;strange-usage-category&#039;] if the module is used on a /doc subpage&lt;br /&gt;
-- or a /testcases subpage. This should be a boolean value (either true or false).&lt;br /&gt;
cfg[&#039;display-strange-usage-category&#039;] = true&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;strange-usage-category&#039;]&lt;br /&gt;
-- Category to output if cfg[&#039;display-strange-usage-category&#039;] is set to true and the module is used on a&lt;br /&gt;
-- /doc subpage or a /testcases subpage.&lt;br /&gt;
cfg[&#039;strange-usage-category&#039;] = &#039;异常使用((documentation))的页面&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--&lt;br /&gt;
-- Don&#039;t edit anything below this line.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
return cfg&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Documentation&amp;diff=480</id>
		<title>模块:Documentation</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Documentation&amp;diff=480"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{documentation}}.&lt;br /&gt;
&lt;br /&gt;
-- Get required modules.&lt;br /&gt;
local getArgs = require(&#039;Module:Arguments&#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&#039;Module:Documentation/config&#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Often-used functions.&lt;br /&gt;
local ugsub = mw.ustring.gsub&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--&lt;br /&gt;
-- These are defined as local functions, but are made available in the p&lt;br /&gt;
-- table for testing purposes.&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray, expectType)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Gets a message from the cfg table and formats it if appropriate.&lt;br /&gt;
	-- The function raises an error if the value from the cfg table is not&lt;br /&gt;
	-- of the type expectType. The default type for expectType is &#039;string&#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &#039;Foo $2 bar $1.&#039;,&lt;br /&gt;
	-- message(&#039;foo-message&#039;, {&#039;baz&#039;, &#039;qux&#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &#039;string&#039;&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&#039;message: type error in message cfg.&#039; .. cfgKey .. &#039; (&#039; .. expectType .. &#039; expected, got &#039; .. type(msg) .. &#039;)&#039;, 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not valArray then&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getMessageVal(match)&lt;br /&gt;
		match = tonumber(match)&lt;br /&gt;
		return valArray[match] or error(&#039;message: no value found for key $&#039; .. match .. &#039; in message cfg.&#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	msg = ugsub(msg, &#039;$([1-9][0-9]*)&#039;, getMessageVal)&lt;br /&gt;
	return msg&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.message = message&lt;br /&gt;
&lt;br /&gt;
local function makeWikilink(page, display)&lt;br /&gt;
	if display then&lt;br /&gt;
		return format(&#039;[[%s|%s]]&#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return format(&#039;[[%s]]&#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &#039;:&#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return format(&#039;[%s %s]&#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&#039;#&#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &#039;documentation-toolbar&#039;&lt;br /&gt;
	return format(&lt;br /&gt;
		&#039;&amp;lt;span class=&amp;quot;%s&amp;quot;&amp;gt;(%s)&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
		message(&#039;toolbar-class&#039;),&lt;br /&gt;
		table.concat(ret, &#039; &amp;amp;#124; &#039;)&lt;br /&gt;
	)&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &#039;string&#039; then&lt;br /&gt;
					value = value:match(&#039;^%s*(.-)%s*$&#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &#039;heading&#039; or value ~= &#039;&#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &#039;testcases&#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &#039;module test cases notice&#039;}&lt;br /&gt;
	else&lt;br /&gt;
		return p.main(frame)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.main = makeInvokeFunc(&#039;_main&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function defines logic flow for the module.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--]]&lt;br /&gt;
	local env = p.getEnvironment(args)&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
	root&lt;br /&gt;
		:wikitext(p._getModuleWikitext(args, env))&lt;br /&gt;
		:wikitext(p.protectionTemplate(env))&lt;br /&gt;
		:wikitext(p.sandboxNotice(args, env))&lt;br /&gt;
		:tag(&#039;div&#039;)&lt;br /&gt;
			-- &#039;documentation-container&#039;&lt;br /&gt;
			:addClass(message(&#039;container&#039;))&lt;br /&gt;
			:attr(&#039;role&#039;, &#039;complementary&#039;)&lt;br /&gt;
			:attr(&#039;aria-labelledby&#039;, args.heading ~= &#039;&#039; and &#039;documentation-heading&#039; or nil)&lt;br /&gt;
			:attr(&#039;aria-label&#039;, args.heading == &#039;&#039; and &#039;Documentation&#039; or nil)&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&#039;div&#039;)&lt;br /&gt;
				-- &#039;documentation&#039;&lt;br /&gt;
				:addClass(message(&#039;main-div-classes&#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&#039;div&#039;)&lt;br /&gt;
					-- &#039;documentation-clear&#039;&lt;br /&gt;
					:addClass(message(&#039;clear&#039;))&lt;br /&gt;
					:done()&lt;br /&gt;
				:newline()&lt;br /&gt;
				:done()&lt;br /&gt;
			:wikitext(p._endBox(args, env))&lt;br /&gt;
			:done()&lt;br /&gt;
		:wikitext(p.addTrackingCategories(env))&lt;br /&gt;
	-- &#039;Module:Documentation/styles.css&#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&#039;templatestyles&#039;, &#039;&#039;, {src=cfg[&#039;templatestyles&#039;]&lt;br /&gt;
	}) .. tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Environment settings&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.getEnvironment(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Returns a table with information about the environment, including title&lt;br /&gt;
	-- objects and other namespace- or path-related data.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--&lt;br /&gt;
	-- Title objects include:&lt;br /&gt;
	-- env.title - the page we are making documentation for (usually the current title)&lt;br /&gt;
	-- env.templateTitle - the template (or module, file, etc.)&lt;br /&gt;
	-- env.docTitle - the /doc subpage.&lt;br /&gt;
	-- env.sandboxTitle - the /sandbox subpage.&lt;br /&gt;
	-- env.testcasesTitle - the /testcases subpage.&lt;br /&gt;
	--&lt;br /&gt;
	-- Data includes:&lt;br /&gt;
	-- env.protectionLevels - the protection levels table of the title object.&lt;br /&gt;
	-- env.subjectSpace - the number of the title&#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &#039;sandbox-subpage&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
		-- &#039;testcases-subpage&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&#039;sandbox-subpage&#039;) or subpage == message(&#039;testcases-subpage&#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &#039;doc-subpage&#039; --&amp;gt; &#039;doc&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &#039;/&#039; .. message(&#039;doc-subpage&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &#039;sandbox-subpage&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &#039;/&#039; .. message(&#039;sandbox-subpage&#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &#039;testcases-subpage&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &#039;/&#039; .. message(&#039;testcases-subpage&#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&lt;br /&gt;
		-- same as the subject namespace. However, pages in the Article, File,&lt;br /&gt;
		-- MediaWiki or Category namespaces must have their /doc, /sandbox and&lt;br /&gt;
		-- /testcases pages in talk space.&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then&lt;br /&gt;
			return subjectSpace + 1&lt;br /&gt;
		else&lt;br /&gt;
			return subjectSpace&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docpageBase()&lt;br /&gt;
		-- The base page of the /doc, /sandbox, and /testcases subpages.&lt;br /&gt;
		-- For some namespaces this is the talk page, rather than the template page.&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local docSpace = env.docSpace&lt;br /&gt;
		local docSpaceText = mw.site.namespaces[docSpace].name&lt;br /&gt;
		-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.&lt;br /&gt;
		return docSpaceText .. &#039;:&#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.canonicalUrl(&lt;br /&gt;
				&#039;Special:ComparePages&#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&#039;_getModuleWikitext&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &#039;Scribunto&#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;sandbox-notice-image&#039; --&amp;gt; &#039;[[File:Sandbox.svg|50px|alt=|link=]]&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-blurb&#039; --&amp;gt; &#039;This is the $1 for $2.&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-diff-blurb&#039; --&amp;gt; &#039;This is the $1 for $2 ($3).&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-pagetype-template&#039; --&amp;gt; &#039;[[Wikipedia:Template test cases|template sandbox]] page&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-pagetype-module&#039; --&amp;gt; &#039;[[Wikipedia:Template test cases|module sandbox]] page&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-pagetype-other&#039; --&amp;gt; &#039;sandbox page&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-compare-link-display&#039; --&amp;gt; &#039;diff&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-testcases-blurb&#039; --&amp;gt; &#039;See also the companion subpage for $1.&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-testcases-link-display&#039; --&amp;gt; &#039;test cases&#039;&lt;br /&gt;
	-- &#039;sandbox-category&#039; --&amp;gt; &#039;Template sandboxes&#039;&lt;br /&gt;
	-- &#039;module-sandbox-category&#039; --&amp;gt; &#039;Module sandboxes&#039;&lt;br /&gt;
	-- &#039;other-sandbox-category&#039; --&amp;gt; &#039;Sandboxes outside of template or module namespace&#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&lt;br /&gt;
		and mw.title.equals(title, sandboxTitle)) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the table of arguments to pass to {{ombox}}. We need just two fields, &amp;quot;image&amp;quot; and &amp;quot;text&amp;quot;.&lt;br /&gt;
	local omargs = {}&lt;br /&gt;
	omargs.image = message(&#039;sandbox-notice-image&#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &#039;__EXPECTUNUSEDTEMPLATE__&#039;&lt;br /&gt;
	local pagetype, sandboxCat&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&#039;sandbox-notice-pagetype-template&#039;)&lt;br /&gt;
		sandboxCat = message(&#039;sandbox-category&#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&#039;sandbox-notice-pagetype-module&#039;)&lt;br /&gt;
		sandboxCat = message(&#039;module-sandbox-category&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&#039;sandbox-notice-pagetype-other&#039;)&lt;br /&gt;
		sandboxCat = message(&#039;other-sandbox-category&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local pagetypee&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetypee = message(&#039;template-pagetype&#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetypee = message(&#039;module-pagetype&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetypee = message(&#039;default-pagetype&#039;) --message &#039;other-pagetype&#039; 不存在&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if compareUrl then&lt;br /&gt;
		local compareDisplay = message(&#039;sandbox-notice-compare-link-display&#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&#039;sandbox-notice-diff-blurb&#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&#039;sandbox-notice-blurb&#039;, {pagetype, templateLink})&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the test cases page blurb if the page exists. This is something like&lt;br /&gt;
	-- &amp;quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&amp;quot;&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot; then&lt;br /&gt;
			local testcasesLinkDisplay = message(&#039;sandbox-notice-testcases-link-display&#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&#039;sandbox-notice-testcases-run-link-display&#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &#039;&amp;lt;br /&amp;gt;&amp;lt;small&amp;gt;&#039; .. message(&#039;sandbox-notice-testcases-run-blurb&#039;, {pagetypee, testcasesLink, testcasesRunLink}) .. &#039;&amp;lt;/small&amp;gt;&#039;&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&#039;sandbox-notice-testcases-link-display&#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &#039;&amp;lt;br /&amp;gt;&amp;lt;small&amp;gt;&#039; .. message(&#039;sandbox-notice-testcases-blurb&#039;, {pagetypee, testcasesLink}) .. &#039;&amp;lt;/small&amp;gt;&#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(sandboxCat)&lt;br /&gt;
&lt;br /&gt;
	-- &#039;documentation-clear&#039;&lt;br /&gt;
	return &#039;&amp;lt;div class=&amp;quot;&#039; .. message(&#039;clear&#039;) .. &#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;&lt;br /&gt;
		.. require(&#039;Module:Message box&#039;).main(&#039;ombox&#039;, omargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.protectionTemplate(env)&lt;br /&gt;
	-- Generates the padlock icon in the top right.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;protection-template&#039; --&amp;gt; &#039;pp-template&#039;&lt;br /&gt;
	-- &#039;protection-template-args&#039; --&amp;gt; {docusage = &#039;yes&#039;}&lt;br /&gt;
	local protectionLevels = env.protectionLevels&lt;br /&gt;
	if not protectionLevels then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local editProt = protectionLevels.edit and protectionLevels.edit[1]&lt;br /&gt;
	local moveProt = protectionLevels.move and protectionLevels.move[1]&lt;br /&gt;
	if editProt then&lt;br /&gt;
		-- The page is edit-protected.&lt;br /&gt;
		return require(&#039;Module:Protection banner&#039;)._main{&lt;br /&gt;
			message(&#039;protection-reason-edit&#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &#039;autoconfirmed&#039; then&lt;br /&gt;
		-- The page is move-protected but not edit-protected. Exclude move&lt;br /&gt;
		-- protection with the level &amp;quot;autoconfirmed&amp;quot;, as this is equivalent to&lt;br /&gt;
		-- no move protection at all.&lt;br /&gt;
		return require(&#039;Module:Protection banner&#039;)._main{&lt;br /&gt;
			action = &#039;move&#039;, small = true&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Start box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.startBox = makeInvokeFunc(&#039;_startBox&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content or args[1] then&lt;br /&gt;
		-- No need to include the links if the documentation is on the template page itself.&lt;br /&gt;
		local linksData = p.makeStartBoxLinksData(args, env)&lt;br /&gt;
		if linksData then&lt;br /&gt;
			links = p.renderStartBoxLinks(linksData)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Generate the start box html.&lt;br /&gt;
	local data = p.makeStartBoxData(args, env, links)&lt;br /&gt;
	if data then&lt;br /&gt;
		return p.renderStartBox(data)&lt;br /&gt;
	else&lt;br /&gt;
		-- User specified no heading.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxLinksData(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Does initial processing of data to make the [view] [edit] [history] [purge] links.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;view-link-display&#039; --&amp;gt; &#039;view&#039;&lt;br /&gt;
	-- &#039;edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;history-link-display&#039; --&amp;gt; &#039;history&#039;&lt;br /&gt;
	-- &#039;purge-link-display&#039; --&amp;gt; &#039;purge&#039;&lt;br /&gt;
	-- &#039;module-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
	-- &#039;docpage-preload&#039; --&amp;gt; &#039;Template:Documentation/preload&#039;&lt;br /&gt;
	-- &#039;create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create link if /doc doesn&#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&#039;module-preload&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&#039;docpage-preload&#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return {&lt;br /&gt;
		title = title,&lt;br /&gt;
		docTitle = docTitle,&lt;br /&gt;
		-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
		viewLinkDisplay = message(&#039;view-link-display&#039;),&lt;br /&gt;
		editLinkDisplay = message(&#039;edit-link-display&#039;),&lt;br /&gt;
		historyLinkDisplay = message(&#039;history-link-display&#039;),&lt;br /&gt;
		purgeLinkDisplay = message(&#039;purge-link-display&#039;),&lt;br /&gt;
		preload = preload,&lt;br /&gt;
		createLinkDisplay = message(&#039;create-link-display&#039;)&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	-- yes, we do intend to purge the template page on which the documentation appears&lt;br /&gt;
	local purgeLink = makeWikilink(&amp;quot;Special:Purge/&amp;quot; .. data.title.prefixedText, data.purgeLinkDisplay)&lt;br /&gt;
	&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, data.historyLinkDisplay)&lt;br /&gt;
		return &amp;quot;&amp;amp;#91;&amp;quot; .. viewLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. editLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. historyLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:canonicalUrl{action = &#039;edit&#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		return  &amp;quot;&amp;amp;#91;&amp;quot; .. createLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;documentation-icon-wikitext&#039; --&amp;gt; &#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&#039;&lt;br /&gt;
	-- &#039;template-namespace-heading&#039; --&amp;gt; &#039;Template documentation&#039;&lt;br /&gt;
	-- &#039;module-namespace-heading&#039; --&amp;gt; &#039;Module documentation&#039;&lt;br /&gt;
	-- &#039;file-namespace-heading&#039; --&amp;gt; &#039;Summary&#039;&lt;br /&gt;
	-- &#039;other-namespaces-heading&#039; --&amp;gt; &#039;Documentation&#039;&lt;br /&gt;
	-- &#039;testcases-create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &#039;&#039; then&lt;br /&gt;
		-- Don&#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&#039;documentation-icon-wikitext&#039;) .. &#039; &#039; .. message(&#039;template-namespace-heading&#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&#039;documentation-icon-wikitext&#039;) .. &#039; &#039; .. message(&#039;module-namespace-heading&#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&#039;file-namespace-heading&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&#039;other-namespaces-heading&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&#039;heading-style&#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &#039;documentation-heading&#039;&lt;br /&gt;
		data.headingClass = message(&#039;main-div-heading-class&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &#039;mw-editsection-like plainlinks&#039;&lt;br /&gt;
		data.linksClass = message(&#039;start-box-link-classes&#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&#039;div&#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &#039;documentation-startbox&#039;&lt;br /&gt;
		:addClass(message(&#039;start-box-class&#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&#039;span&#039;)&lt;br /&gt;
			:addClass(data.headingClass)&lt;br /&gt;
			:attr(&#039;id&#039;, &#039;documentation-heading&#039;)&lt;br /&gt;
			:cssText(data.headingStyleText)&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox:tag(&#039;span&#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&#039;id&#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&#039;_content&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}&lt;br /&gt;
	end&lt;br /&gt;
	-- The line breaks below are necessary so that &amp;quot;=== Headings ===&amp;quot; at the start and end&lt;br /&gt;
	-- of docs are interpreted correctly.&lt;br /&gt;
	return &#039;\n&#039; .. (content or &#039;&#039;) .. &#039;\n&#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&#039;_contentTitle&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;&#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&#039;_endBox&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&lt;br /&gt;
	-- Get environment data.&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not subjectSpace or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	-- Check whether we should output the end box at all. Add the end&lt;br /&gt;
	-- box by default if the documentation exists or if we are in the&lt;br /&gt;
	-- user, module or template namespaces.&lt;br /&gt;
	local linkBox = args[&#039;link box&#039;]&lt;br /&gt;
	if linkBox == &#039;off&#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &#039;&#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &#039;&#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &#039;&#039;) .. &#039;&amp;lt;br /&amp;gt;&#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &#039;&#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &#039; &#039; .. (p.makeSubpagesBlurb(args, env) or &#039;&#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&#039;div&#039;)&lt;br /&gt;
	-- &#039;documentation-metadata&#039;&lt;br /&gt;
	box:attr(&#039;role&#039;, &#039;note&#039;)&lt;br /&gt;
		:addClass(message(&#039;end-box-class&#039;))&lt;br /&gt;
		-- &#039;plainlinks&#039;&lt;br /&gt;
		:addClass(message(&#039;end-box-plainlinks&#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &#039;\n&#039; .. tostring(box)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeDocPageBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Makes the blurb &amp;quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&amp;quot;.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;history-link-display&#039; --&amp;gt; &#039;history&#039;&lt;br /&gt;
	-- &#039;transcluded-from-blurb&#039; --&amp;gt; &lt;br /&gt;
	-- &#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&#039;&lt;br /&gt;
	-- &#039;module-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
	-- &#039;create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	-- &#039;create-module-doc-blurb&#039; --&amp;gt;&lt;br /&gt;
	-- &#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		-- /doc exists; link to it.&lt;br /&gt;
		local docLink = makeWikilink(docTitle.prefixedText)&lt;br /&gt;
		local editDisplay = message(&#039;edit-link-display&#039;)&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, editDisplay)&lt;br /&gt;
		local historyDisplay = message(&#039;history-link-display&#039;)&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, historyDisplay)&lt;br /&gt;
		return message(&#039;transcluded-from-blurb&#039;, {docLink})&lt;br /&gt;
			.. &#039; &#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &#039;&amp;lt;br /&amp;gt;&#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:canonicalUrl{action = &#039;edit&#039;, preload = message(&#039;module-preload&#039;)}&lt;br /&gt;
		local createDisplay = message(&#039;create-link-display&#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		return message(&#039;create-module-doc-blurb&#039;, {createLink})&lt;br /&gt;
			.. &#039;&amp;lt;br /&amp;gt;&#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;sandbox-link-display&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
	-- &#039;sandbox-edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;compare-link-display&#039; --&amp;gt; &#039;diff&#039;&lt;br /&gt;
	-- &#039;module-sandbox-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-sandbox&#039;&lt;br /&gt;
	-- &#039;template-sandbox-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
	-- &#039;sandbox-create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	-- &#039;mirror-edit-summary&#039; --&amp;gt; &#039;Create sandbox version of $1&#039;&lt;br /&gt;
	-- &#039;mirror-link-display&#039; --&amp;gt; &#039;mirror&#039;&lt;br /&gt;
	-- &#039;mirror-link-preload&#039; --&amp;gt; &#039;Template:Documentation/mirror&#039;&lt;br /&gt;
	-- &#039;sandbox-link-display&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
	-- &#039;testcases-link-display&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
	-- &#039;testcases-edit-link-display&#039;--&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;template-sandbox-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
	-- &#039;testcases-create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	-- &#039;testcases-link-display&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
	-- &#039;testcases-edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;module-testcases-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-testcases&#039;&lt;br /&gt;
	-- &#039;template-testcases-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-testcases&#039;&lt;br /&gt;
	-- &#039;experiment-blurb-module&#039; --&amp;gt; &#039;Editors can experiment in this module&#039;s $1 and $2 pages.&#039;&lt;br /&gt;
	-- &#039;experiment-blurb-template&#039; --&amp;gt; &#039;Editors can experiment in this template&#039;s $1 and $2 pages.&#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&#039;sandbox-link-display&#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditDisplay = message(&#039;sandbox-edit-link-display&#039;)&lt;br /&gt;
		local sandboxEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. sandboxPage, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&#039;compare-link-display&#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &#039; &#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&#039;module-sandbox-preload&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&#039;template-sandbox-preload&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = &#039;edit&#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&#039;sandbox-create-link-display&#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&#039;mirror-edit-summary&#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&#039;mirror-link-preload&#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:canonicalUrl{action = &#039;edit&#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:canonicalUrl{action = &#039;edit&#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&#039;mirror-link-display&#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&#039;sandbox-link-display&#039;) .. &#039; &#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&#039;testcases-link-display&#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:canonicalUrl{action = &#039;edit&#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&#039;testcases-edit-link-display&#039;)&lt;br /&gt;
		local testcasesEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. testcasesPage, testcasesEditDisplay)&lt;br /&gt;
		-- for Modules, add testcases run link if exists&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot;  and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&#039;testcases-run-link-display&#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &#039; &#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &#039; &#039; .. makeToolbar(testcasesEditLink)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message(&#039;module-testcases-preload&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&#039;template-testcases-preload&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = &#039;edit&#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&#039;testcases-create-link-display&#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&#039;testcases-link-display&#039;) .. &#039; &#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &#039;experiment-blurb-module&#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &#039;experiment-blurb-template&#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;doc-link-display&#039; --&amp;gt; &#039;/doc&#039;&lt;br /&gt;
	-- &#039;add-categories-blurb&#039; --&amp;gt; &#039;Please add categories to the $1 subpage.&#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&#039;doc-link-display&#039;))&lt;br /&gt;
	return message(&#039;add-categories-blurb&#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;template-pagetype&#039; --&amp;gt; &#039;template&#039;&lt;br /&gt;
	-- &#039;module-pagetype&#039; --&amp;gt; &#039;module&#039;&lt;br /&gt;
	-- &#039;default-pagetype&#039; --&amp;gt; &#039;page&#039;&lt;br /&gt;
	-- &#039;subpages-link-display&#039; --&amp;gt; &#039;Subpages of this $1&#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&#039;template-pagetype&#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&#039;module-pagetype&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&#039;default-pagetype&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&#039;Special:PrefixIndex/&#039; .. templateTitle.prefixedText .. &#039;/&#039;,&lt;br /&gt;
		message(&#039;subpages-link-display&#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&#039;subpages-blurb&#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;display-strange-usage-category&#039; --&amp;gt; true&lt;br /&gt;
	-- &#039;doc-subpage&#039; --&amp;gt; &#039;doc&#039;&lt;br /&gt;
	-- &#039;testcases-subpage&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
	-- &#039;strange-usage-category&#039; --&amp;gt; &#039;Wikipedia pages with strange ((documentation)) usage&#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	if message(&#039;display-strange-usage-category&#039;, nil, &#039;boolean&#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&#039;doc-subpage&#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&#039;testcases-subpage&#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return makeCategoryLink(message(&#039;strange-usage-category&#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Redirect&amp;diff=478</id>
		<title>模块:Redirect</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Redirect&amp;diff=478"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides functions for getting the target of a redirect page.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Gets a mw.title object, using pcall to avoid generating script errors if we&lt;br /&gt;
-- are over the expensive function count limit (among other possible causes).&lt;br /&gt;
local function getTitle(...)&lt;br /&gt;
	local success, titleObj = pcall(mw.title.new, ...)&lt;br /&gt;
	if success then&lt;br /&gt;
		return titleObj&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the name of a page that a redirect leads to, or nil if it isn&#039;t a&lt;br /&gt;
-- redirect.&lt;br /&gt;
function p.getTargetFromText(text)&lt;br /&gt;
	local target = string.match(&lt;br /&gt;
		text,&lt;br /&gt;
		&amp;quot;^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]&amp;quot;&lt;br /&gt;
	) or string.match(&lt;br /&gt;
		text,&lt;br /&gt;
		&amp;quot;^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]&amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
	return target and mw.uri.decode(target, &#039;PATH&#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the target of a redirect. If the page specified is not a redirect,&lt;br /&gt;
-- returns nil.&lt;br /&gt;
function p.getTarget(page, fulltext)&lt;br /&gt;
	-- Get the title object. Both page names and title objects are allowed&lt;br /&gt;
	-- as input.&lt;br /&gt;
	local titleObj&lt;br /&gt;
	if type(page) == &#039;string&#039; or type(page) == &#039;number&#039; then&lt;br /&gt;
		titleObj = getTitle(page)&lt;br /&gt;
	elseif type(page) == &#039;table&#039; and type(page.getContent) == &#039;function&#039; then&lt;br /&gt;
		titleObj = page&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&amp;quot;bad argument #1 to &#039;getTarget&#039;&amp;quot;&lt;br /&gt;
				.. &amp;quot; (string, number, or title object expected, got %s)&amp;quot;,&lt;br /&gt;
			type(page)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not titleObj then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local targetTitle = titleObj.redirectTarget&lt;br /&gt;
	if targetTitle then&lt;br /&gt;
		if fulltext then&lt;br /&gt;
			return targetTitle.fullText&lt;br /&gt;
		else&lt;br /&gt;
			return targetTitle.prefixedText&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- Given a single page name determines what page it redirects to and returns the&lt;br /&gt;
-- target page name, or the passed page name when not a redirect. The passed&lt;br /&gt;
-- page name can be given as plain text or as a page link.&lt;br /&gt;
--&lt;br /&gt;
-- Returns page name as plain text, or when the bracket parameter is given, as a&lt;br /&gt;
-- page link. Returns an error message when page does not exist or the redirect&lt;br /&gt;
-- target cannot be determined for some reason.&lt;br /&gt;
--]]&lt;br /&gt;
function p.luaMain(rname, bracket, fulltext)&lt;br /&gt;
	if type(rname) ~= &amp;quot;string&amp;quot; or not rname:find(&amp;quot;%S&amp;quot;) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	bracket = bracket and &amp;quot;[[%s]]&amp;quot; or &amp;quot;%s&amp;quot;&lt;br /&gt;
	rname = rname:match(&amp;quot;%[%[(.+)%]%]&amp;quot;) or rname&lt;br /&gt;
	local target = p.getTarget(rname, fulltext)&lt;br /&gt;
	local ret = target or rname&lt;br /&gt;
	ret = getTitle(ret)&lt;br /&gt;
	if ret then&lt;br /&gt;
		if fulltext then&lt;br /&gt;
			ret = ret.fullText&lt;br /&gt;
		else&lt;br /&gt;
			ret = ret.prefixedText&lt;br /&gt;
		end&lt;br /&gt;
		return bracket:format(ret)&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provides access to the luaMain function from wikitext.&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, {frameOnly = true})&lt;br /&gt;
	return p.luaMain(args[1], args.bracket, args.fulltext) or &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns true if the specified page is a redirect, and false otherwise.&lt;br /&gt;
function p.luaIsRedirect(page)&lt;br /&gt;
	local titleObj = getTitle(page)&lt;br /&gt;
	if not titleObj then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if titleObj.isRedirect then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provides access to the luaIsRedirect function from wikitext, returning &#039;yes&#039;&lt;br /&gt;
-- if the specified page is a redirect, and the blank string otherwise.&lt;br /&gt;
function p.isRedirect(frame)&lt;br /&gt;
	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, {frameOnly = true})&lt;br /&gt;
	if p.luaIsRedirect(args[1]) then&lt;br /&gt;
		return &#039;yes&#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;&#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_level&amp;diff=476</id>
		<title>模块:Effective protection level</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Effective_protection_level&amp;diff=476"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Returns the permission required to perform a given action on a given title.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == &#039;table&#039; and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action ~= &#039;edit&#039; and action ~= &#039;move&#039; and action ~= &#039;create&#039; and action ~= &#039;upload&#039; and action ~= &#039;undelete&#039; then&lt;br /&gt;
		error( &#039;First parameter must be one of edit, move, create, upload, undelete&#039;, 2 )&lt;br /&gt;
	end&lt;br /&gt;
	if title.namespace == 8 then -- MediaWiki namespace&lt;br /&gt;
		if title.text:sub(-3) == &#039;.js&#039; or title.text:sub(-4) == &#039;.css&#039; or title.text == &#039;Gadgets-definition&#039; or title.contentModel == &#039;javascript&#039; or title.contentModel == &#039;css&#039; then -- site JS or CSS page&lt;br /&gt;
			return &#039;interfaceadmin&#039;&lt;br /&gt;
		else -- any non-JS/CSS MediaWiki page&lt;br /&gt;
			return &#039;sysop&#039;&lt;br /&gt;
		end&lt;br /&gt;
	elseif title.namespace == 2 and title.isSubpage then&lt;br /&gt;
		if title.contentModel == &#039;javascript&#039; or title.contentModel == &#039;css&#039; then -- user JS or CSS page&lt;br /&gt;
			return &#039;interfaceadmin&#039;&lt;br /&gt;
		elseif title.contentModel == &#039;json&#039; then -- user JSON page&lt;br /&gt;
			return &#039;sysop&#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if action == &#039;undelete&#039; then&lt;br /&gt;
		return &#039;sysop&#039;&lt;br /&gt;
	end&lt;br /&gt;
	local level = title.protectionLevels[action] and title.protectionLevels[action][1]&lt;br /&gt;
	if level == &#039;sysop&#039; or level == &#039;editprotected&#039; then&lt;br /&gt;
		return &#039;sysop&#039;&lt;br /&gt;
	elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page&lt;br /&gt;
		return &#039;sysop&#039;&lt;br /&gt;
	elseif level == &#039;templateeditor&#039; then&lt;br /&gt;
		return &#039;templateeditor&#039;&lt;br /&gt;
	elseif action == &#039;move&#039; then&lt;br /&gt;
		local blacklistentry = mw.ext.TitleBlacklist.test(&#039;edit&#039;, pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.&lt;br /&gt;
		if blacklistentry and not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return &#039;sysop&#039;&lt;br /&gt;
		elseif title.namespace == 6 then&lt;br /&gt;
			return &#039;filemover&#039;&lt;br /&gt;
		elseif level == &#039;extendedconfirmed&#039; then&lt;br /&gt;
			return &#039;extendedconfirmed&#039;&lt;br /&gt;
		else&lt;br /&gt;
			return &#039;autoconfirmed&#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)&lt;br /&gt;
	if blacklistentry then&lt;br /&gt;
		if not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return &#039;sysop&#039;&lt;br /&gt;
		elseif level == &#039;extendedconfirmed&#039; then&lt;br /&gt;
			return &#039;extendedconfirmed&#039;&lt;br /&gt;
		else&lt;br /&gt;
			return &#039;autoconfirmed&#039;&lt;br /&gt;
		end&lt;br /&gt;
	elseif level == &#039;editsemiprotected&#039; then -- create-semiprotected pages return this for some reason&lt;br /&gt;
		return &#039;autoconfirmed&#039;&lt;br /&gt;
	elseif level then&lt;br /&gt;
		return level&lt;br /&gt;
	elseif action == &#039;upload&#039; then&lt;br /&gt;
		return &#039;autoconfirmed&#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;*&#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Webarchive&amp;diff=474</id>
		<title>模板:Webarchive</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Webarchive&amp;diff=474"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:webarchive|webarchive}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_conference&amp;diff=472</id>
		<title>模板:Cite conference</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_conference&amp;diff=472"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=conference&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Citation&amp;diff=470</id>
		<title>模板:Citation</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Citation&amp;diff=470"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=citation&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Namespace_detect&amp;diff=468</id>
		<title>模块:Namespace detect</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Namespace_detect&amp;diff=468"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--                            NAMESPACE DETECT                                --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module implements the {{namespace detect}} template in Lua, with a    --&lt;br /&gt;
-- few improvements: all namespaces and all namespace aliases are supported,  --&lt;br /&gt;
-- and namespace names are detected automatically for the local wiki. The     --&lt;br /&gt;
-- module can also use the corresponding subject namespace value if it is     --&lt;br /&gt;
-- used on a talk page. Parameter names can be configured for different wikis --&lt;br /&gt;
-- by altering the values in the &amp;quot;cfg&amp;quot; table in                               --&lt;br /&gt;
-- Module:Namespace detect/config.                                            --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local data = mw.loadData(&#039;Module:Namespace detect/data&#039;)&lt;br /&gt;
local argKeys = data.argKeys&lt;br /&gt;
local cfg = data.cfg&lt;br /&gt;
local mappings = data.mappings&lt;br /&gt;
&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&lt;br /&gt;
local mArguments -- Lazily initialise Module:Arguments&lt;br /&gt;
local mTableTools -- Lazily initilalise Module:TableTools&lt;br /&gt;
local ustringLower = mw.ustring.lower&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function fetchValue(t1, t2)&lt;br /&gt;
	-- Fetches a value from the table t1 for the first key in array t2 where&lt;br /&gt;
	-- a non-nil value of t1 exists.&lt;br /&gt;
	for i, key in ipairs(t2) do&lt;br /&gt;
		local value = t1[key]&lt;br /&gt;
		if value ~= nil then&lt;br /&gt;
			return value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function equalsArrayValue(t, value)&lt;br /&gt;
	-- Returns true if value equals a value in the array t. Otherwise&lt;br /&gt;
	-- returns false.&lt;br /&gt;
	for i, arrayValue in ipairs(t) do&lt;br /&gt;
		if value == arrayValue then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getPageObject(page)&lt;br /&gt;
	-- Get the page object, passing the function through pcall in case of&lt;br /&gt;
	-- errors, e.g. being over the expensive function count limit.&lt;br /&gt;
	if page then&lt;br /&gt;
		local success, pageObject = pcall(mw.title.new, page)&lt;br /&gt;
		if success then&lt;br /&gt;
			return pageObject&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provided for backward compatibility with other modules&lt;br /&gt;
function p.getParamMappings()&lt;br /&gt;
	return mappings&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getNamespace(args)&lt;br /&gt;
	-- This function gets the namespace name from the page object.&lt;br /&gt;
	local page = fetchValue(args, argKeys.demopage)&lt;br /&gt;
	if page == &#039;&#039; then&lt;br /&gt;
		page = nil&lt;br /&gt;
	end&lt;br /&gt;
	local demospace = fetchValue(args, argKeys.demospace)&lt;br /&gt;
	if demospace == &#039;&#039; then&lt;br /&gt;
		demospace = nil&lt;br /&gt;
	end&lt;br /&gt;
	local subjectns = fetchValue(args, argKeys.subjectns)&lt;br /&gt;
	local ret&lt;br /&gt;
	if demospace then&lt;br /&gt;
		-- Handle &amp;quot;demospace = main&amp;quot; properly.&lt;br /&gt;
		if equalsArrayValue(argKeys.main, ustringLower(demospace)) then&lt;br /&gt;
			ret = mw.site.namespaces[0].name&lt;br /&gt;
		else&lt;br /&gt;
			ret = demospace&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local pageObject = p.getPageObject(page)&lt;br /&gt;
		if pageObject then&lt;br /&gt;
			if pageObject.isTalkPage then&lt;br /&gt;
				-- Get the subject namespace if the option is set,&lt;br /&gt;
				-- otherwise use &amp;quot;talk&amp;quot;.&lt;br /&gt;
				if yesno(subjectns) then&lt;br /&gt;
					ret = mw.site.namespaces[pageObject.namespace].subject.name&lt;br /&gt;
				else&lt;br /&gt;
					ret = &#039;talk&#039;&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				ret = pageObject.nsText&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return nil -- return nil if the page object doesn&#039;t exist.&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	ret = ret:gsub(&#039;_&#039;, &#039; &#039;)&lt;br /&gt;
	return ustringLower(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	-- Check the parameters stored in the mappings table for any matches.&lt;br /&gt;
	local namespace = getNamespace(args) or &#039;other&#039; -- &amp;quot;other&amp;quot; avoids nil table keys&lt;br /&gt;
	local params = mappings[namespace] or {}&lt;br /&gt;
	local ret = fetchValue(args, params)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- If there were no matches, return parameters for other namespaces.&lt;br /&gt;
	-- This happens if there was no text specified for the namespace that&lt;br /&gt;
	-- was detected or if the demospace parameter is not a valid&lt;br /&gt;
	-- namespace. Note that the parameter for the detected namespace must be&lt;br /&gt;
	-- completely absent for this to happen, not merely blank.&lt;br /&gt;
	--]]&lt;br /&gt;
	if ret == nil then&lt;br /&gt;
		ret = fetchValue(args, argKeys.other)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	mArguments = require(&#039;Module:Arguments&#039;)&lt;br /&gt;
	local args = mArguments.getArgs(frame, {removeBlanks = false})&lt;br /&gt;
	local ret = p._main(args)&lt;br /&gt;
	return ret or &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.table(frame)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Create a wikitable of all subject namespace parameters, for&lt;br /&gt;
	-- documentation purposes. The talk parameter is optional, in case it&lt;br /&gt;
	-- needs to be excluded in the documentation.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	-- Load modules and initialise variables.&lt;br /&gt;
	mTableTools = require(&#039;Module:TableTools&#039;)&lt;br /&gt;
	local namespaces = mw.site.namespaces&lt;br /&gt;
	local cfg = data.cfg&lt;br /&gt;
	local useTalk = type(frame) == &#039;table&#039; &lt;br /&gt;
		and type(frame.args) == &#039;table&#039; &lt;br /&gt;
		and yesno(frame.args.talk) -- Whether to use the talk parameter.&lt;br /&gt;
	&lt;br /&gt;
	-- Get the header names.&lt;br /&gt;
	local function checkValue(value, default)&lt;br /&gt;
		if type(value) == &#039;string&#039; then&lt;br /&gt;
			return value&lt;br /&gt;
		else&lt;br /&gt;
			return default&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local nsHeader = checkValue(cfg.wikitableNamespaceHeader, &#039;Namespace&#039;)&lt;br /&gt;
	local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, &#039;Aliases&#039;)&lt;br /&gt;
&lt;br /&gt;
	-- Put the namespaces in order.&lt;br /&gt;
	local mappingsOrdered = {}&lt;br /&gt;
	for nsname, params in pairs(mappings) do&lt;br /&gt;
		if useTalk or nsname ~= &#039;talk&#039; then&lt;br /&gt;
			local nsid = namespaces[nsname].id&lt;br /&gt;
			-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.&lt;br /&gt;
			nsid = nsid + 1 &lt;br /&gt;
			mappingsOrdered[nsid] = params&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)&lt;br /&gt;
&lt;br /&gt;
	-- Build the table.&lt;br /&gt;
	local ret = &#039;{| class=&amp;quot;wikitable&amp;quot;&#039;&lt;br /&gt;
		.. &#039;\n|-&#039;&lt;br /&gt;
		.. &#039;\n! &#039; .. nsHeader&lt;br /&gt;
		.. &#039;\n! &#039; .. aliasesHeader&lt;br /&gt;
	for i, params in ipairs(mappingsOrdered) do&lt;br /&gt;
		for j, param in ipairs(params) do&lt;br /&gt;
			if j == 1 then&lt;br /&gt;
				ret = ret .. &#039;\n|-&#039;&lt;br /&gt;
					.. &#039;\n| &amp;lt;code&amp;gt;&#039; .. param .. &#039;&amp;lt;/code&amp;gt;&#039;&lt;br /&gt;
					.. &#039;\n| &#039;&lt;br /&gt;
			elseif j == 2 then&lt;br /&gt;
				ret = ret .. &#039;&amp;lt;code&amp;gt;&#039; .. param .. &#039;&amp;lt;/code&amp;gt;&#039;&lt;br /&gt;
			else&lt;br /&gt;
				ret = ret .. &#039;, &amp;lt;code&amp;gt;&#039; .. param .. &#039;&amp;lt;/code&amp;gt;&#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	ret = ret .. &#039;\n|-&#039;&lt;br /&gt;
		.. &#039;\n|}&#039;&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Error&amp;diff=466</id>
		<title>模块:Error</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Error&amp;diff=466"/>
		<updated>2025-09-28T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{error}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._error(args)&lt;br /&gt;
    local tag = mw.ustring.lower(tostring(args.tag))&lt;br /&gt;
&lt;br /&gt;
    -- Work out what html tag we should use.&lt;br /&gt;
    if not (tag == &#039;p&#039; or tag == &#039;span&#039; or tag == &#039;div&#039;) then&lt;br /&gt;
        tag = &#039;strong&#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Generate the html.&lt;br /&gt;
    return tostring(mw.html.create(tag)&lt;br /&gt;
        :addClass(&#039;error&#039;)&lt;br /&gt;
        :cssText(args.style)&lt;br /&gt;
        :wikitext(tostring(args.message or args[1] or error(&#039;no message specified&#039;, 2)))&lt;br /&gt;
    )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.error(frame)&lt;br /&gt;
    local args&lt;br /&gt;
    if type(frame.args) == &#039;table&#039; then&lt;br /&gt;
        -- We&#039;re being called via #invoke. The args are passed through to the module&lt;br /&gt;
        -- from the template page, so use the args that were passed into the template.&lt;br /&gt;
        args = frame.args&lt;br /&gt;
    else&lt;br /&gt;
        -- We&#039;re being called from another module or from the debug console, so assume&lt;br /&gt;
        -- the args are passed in directly.&lt;br /&gt;
        args = frame&lt;br /&gt;
    end&lt;br /&gt;
    -- if the message parameter is present but blank, change it to nil so that Lua will&lt;br /&gt;
    -- consider it false.&lt;br /&gt;
    if args.message == &amp;quot;&amp;quot; then&lt;br /&gt;
        args.message = nil&lt;br /&gt;
    end&lt;br /&gt;
    return p._error(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Redirect&amp;diff=464</id>
		<title>模块:Redirect</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Redirect&amp;diff=464"/>
		<updated>2025-09-28T15:21:25Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides functions for getting the target of a redirect page.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Gets a mw.title object, using pcall to avoid generating script errors if we&lt;br /&gt;
-- are over the expensive function count limit (among other possible causes).&lt;br /&gt;
local function getTitle(...)&lt;br /&gt;
	local success, titleObj = pcall(mw.title.new, ...)&lt;br /&gt;
	if success then&lt;br /&gt;
		return titleObj&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the name of a page that a redirect leads to, or nil if it isn&#039;t a&lt;br /&gt;
-- redirect.&lt;br /&gt;
function p.getTargetFromText(text)&lt;br /&gt;
	local target = string.match(&lt;br /&gt;
		text,&lt;br /&gt;
		&amp;quot;^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]&amp;quot;&lt;br /&gt;
	) or string.match(&lt;br /&gt;
		text,&lt;br /&gt;
		&amp;quot;^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]&amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
	return target and mw.uri.decode(target, &#039;PATH&#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the target of a redirect. If the page specified is not a redirect,&lt;br /&gt;
-- returns nil.&lt;br /&gt;
function p.getTarget(page, fulltext)&lt;br /&gt;
	-- Get the title object. Both page names and title objects are allowed&lt;br /&gt;
	-- as input.&lt;br /&gt;
	local titleObj&lt;br /&gt;
	if type(page) == &#039;string&#039; or type(page) == &#039;number&#039; then&lt;br /&gt;
		titleObj = getTitle(page)&lt;br /&gt;
	elseif type(page) == &#039;table&#039; and type(page.getContent) == &#039;function&#039; then&lt;br /&gt;
		titleObj = page&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&amp;quot;bad argument #1 to &#039;getTarget&#039;&amp;quot;&lt;br /&gt;
				.. &amp;quot; (string, number, or title object expected, got %s)&amp;quot;,&lt;br /&gt;
			type(page)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not titleObj then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local targetTitle = titleObj.redirectTarget&lt;br /&gt;
	if targetTitle then&lt;br /&gt;
		if fulltext then&lt;br /&gt;
			return targetTitle.fullText&lt;br /&gt;
		else&lt;br /&gt;
			return targetTitle.prefixedText&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- Given a single page name determines what page it redirects to and returns the&lt;br /&gt;
-- target page name, or the passed page name when not a redirect. The passed&lt;br /&gt;
-- page name can be given as plain text or as a page link.&lt;br /&gt;
--&lt;br /&gt;
-- Returns page name as plain text, or when the bracket parameter is given, as a&lt;br /&gt;
-- page link. Returns an error message when page does not exist or the redirect&lt;br /&gt;
-- target cannot be determined for some reason.&lt;br /&gt;
--]]&lt;br /&gt;
function p.luaMain(rname, bracket, fulltext)&lt;br /&gt;
	if type(rname) ~= &amp;quot;string&amp;quot; or not rname:find(&amp;quot;%S&amp;quot;) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	bracket = bracket and &amp;quot;[[%s]]&amp;quot; or &amp;quot;%s&amp;quot;&lt;br /&gt;
	rname = rname:match(&amp;quot;%[%[(.+)%]%]&amp;quot;) or rname&lt;br /&gt;
	local target = p.getTarget(rname, fulltext)&lt;br /&gt;
	local ret = target or rname&lt;br /&gt;
	ret = getTitle(ret)&lt;br /&gt;
	if ret then&lt;br /&gt;
		if fulltext then&lt;br /&gt;
			ret = ret.fullText&lt;br /&gt;
		else&lt;br /&gt;
			ret = ret.prefixedText&lt;br /&gt;
		end&lt;br /&gt;
		return bracket:format(ret)&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provides access to the luaMain function from wikitext.&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, {frameOnly = true})&lt;br /&gt;
	return p.luaMain(args[1], args.bracket, args.fulltext) or &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns true if the specified page is a redirect, and false otherwise.&lt;br /&gt;
function p.luaIsRedirect(page)&lt;br /&gt;
	local titleObj = getTitle(page)&lt;br /&gt;
	if not titleObj then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if titleObj.isRedirect then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provides access to the luaIsRedirect function from wikitext, returning &#039;yes&#039;&lt;br /&gt;
-- if the specified page is a redirect, and the blank string otherwise.&lt;br /&gt;
function p.isRedirect(frame)&lt;br /&gt;
	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, {frameOnly = true})&lt;br /&gt;
	if p.luaIsRedirect(args[1]) then&lt;br /&gt;
		return &#039;yes&#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;&#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Message_box/configuration&amp;diff=462</id>
		<title>模块:Message box/configuration</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Message_box/configuration&amp;diff=462"/>
		<updated>2025-09-28T15:21:24Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local ambox = {&lt;br /&gt;
	types = {&lt;br /&gt;
		speedy = {&lt;br /&gt;
			class = &#039;ambox-speedy&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		delete = {&lt;br /&gt;
			class = &#039;ambox-delete&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		content = {&lt;br /&gt;
			class = &#039;ambox-content&#039;,&lt;br /&gt;
			image = &#039;Ambox important.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		style = {&lt;br /&gt;
			class = &#039;ambox-style&#039;,&lt;br /&gt;
			image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		move = {&lt;br /&gt;
			class = &#039;ambox-move&#039;,&lt;br /&gt;
			image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		protection = {&lt;br /&gt;
			class = &#039;ambox-protection&#039;,&lt;br /&gt;
			image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		notice = {&lt;br /&gt;
			class = &#039;ambox-notice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	default                     = &#039;notice&#039;,&lt;br /&gt;
	allowBlankParams            = {&#039;talk&#039;, &#039;sect&#039;, &#039;date&#039;, &#039;issue&#039;, &#039;fix&#039;, &#039;subst&#039;, &#039;hidden&#039;},&lt;br /&gt;
	allowSmall                  = true,&lt;br /&gt;
	smallParam                  = &#039;left&#039;,&lt;br /&gt;
	smallClass                  = &#039;mbox-small-left&#039;,&lt;br /&gt;
	substCheck                  = true,&lt;br /&gt;
	classes                     = {&#039;metadata&#039;, &#039;ambox&#039;},&lt;br /&gt;
	usePlainlinksParam          = true,&lt;br /&gt;
	allowId                     = true,&lt;br /&gt;
	imageEmptyCell              = true,&lt;br /&gt;
	imageCheckBlank             = true,&lt;br /&gt;
	imageSmallSize              = &#039;20x20px&#039;,&lt;br /&gt;
	imageCellDiv                = true,&lt;br /&gt;
	useCollapsibleTextFields    = true,&lt;br /&gt;
	imageRightNone              = true,&lt;br /&gt;
	sectionDefault              = &#039;條目&#039;,&lt;br /&gt;
	allowMainspaceCategories    = true,&lt;br /&gt;
	templateCategory            = &#039;條目訊息模板&#039;,&lt;br /&gt;
        templateCategoryRequireName = true,&lt;br /&gt;
	templateErrorCategory       = &#039;缺少參數的條目訊息模板&#039;,&lt;br /&gt;
	templateErrorParamsToCheck  = {&#039;issue&#039;, &#039;fix&#039;, &#039;subst&#039;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local cmbox = {&lt;br /&gt;
	types = {&lt;br /&gt;
		speedy = {&lt;br /&gt;
			class = &#039;cmbox-speedy&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		delete = {&lt;br /&gt;
			class = &#039;cmbox-delete&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		content = {&lt;br /&gt;
			class = &#039;cmbox-content&#039;,&lt;br /&gt;
			image = &#039;Ambox important.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		style = {&lt;br /&gt;
			class = &#039;cmbox-style&#039;,&lt;br /&gt;
			image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		move = {&lt;br /&gt;
			class = &#039;cmbox-move&#039;,&lt;br /&gt;
			image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		protection = {&lt;br /&gt;
			class = &#039;cmbox-protection&#039;,&lt;br /&gt;
			image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		notice = {&lt;br /&gt;
			class = &#039;cmbox-notice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	default              = &#039;notice&#039;,&lt;br /&gt;
	showInvalidTypeError = true,&lt;br /&gt;
	classes              = {&#039;cmbox&#039;},&lt;br /&gt;
	usePlainlinksParam   = true,&lt;br /&gt;
	imageEmptyCell       = true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local fmbox = {&lt;br /&gt;
	types = {&lt;br /&gt;
		warning = {&lt;br /&gt;
			class = &#039;fmbox-warning&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		editnotice = {&lt;br /&gt;
			class = &#039;fmbox-editnotice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		system = {&lt;br /&gt;
			class = &#039;fmbox-system&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	default              = &#039;system&#039;,&lt;br /&gt;
	showInvalidTypeError = true,&lt;br /&gt;
	allowId                = true,&lt;br /&gt;
	classes              = {&#039;fmbox&#039;},&lt;br /&gt;
	usePlainlinksParam   = true,&lt;br /&gt;
	imageEmptyCell       = false,&lt;br /&gt;
	imageRightNone       = false&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local imbox = {&lt;br /&gt;
	types = {&lt;br /&gt;
		speedy = {&lt;br /&gt;
			class = &#039;imbox-speedy&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		delete = {&lt;br /&gt;
			class = &#039;imbox-delete&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		content = {&lt;br /&gt;
			class = &#039;imbox-content&#039;,&lt;br /&gt;
			image = &#039;Ambox important.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		style = {&lt;br /&gt;
			class = &#039;imbox-style&#039;,&lt;br /&gt;
			image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		move = {&lt;br /&gt;
			class = &#039;imbox-move&#039;,&lt;br /&gt;
			image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		protection = {&lt;br /&gt;
			class = &#039;imbox-protection&#039;,&lt;br /&gt;
			image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		license = {&lt;br /&gt;
			class = &#039;imbox-license&#039;,&lt;br /&gt;
			image = &#039;Imbox license.png&#039;&lt;br /&gt;
		},&lt;br /&gt;
		featured = {&lt;br /&gt;
			class = &#039;imbox-featured&#039;,&lt;br /&gt;
			image = &#039;Cscr-featured.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		notice = {&lt;br /&gt;
			class = &#039;imbox-notice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	default              = &#039;notice&#039;,&lt;br /&gt;
	showInvalidTypeError = true,&lt;br /&gt;
	classes              = {&#039;imbox&#039;},&lt;br /&gt;
	usePlainlinksParam   = true,&lt;br /&gt;
	imageEmptyCell       = true,&lt;br /&gt;
	below                = true,&lt;br /&gt;
	templateCategory     = &#039;檔案訊息模板&#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local ombox = {&lt;br /&gt;
	types = {&lt;br /&gt;
		speedy = {&lt;br /&gt;
			class = &#039;ombox-speedy&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		delete = {&lt;br /&gt;
			class = &#039;ombox-delete&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		content = {&lt;br /&gt;
			class = &#039;ombox-content&#039;,&lt;br /&gt;
			image = &#039;Ambox important.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		style = {&lt;br /&gt;
			class = &#039;ombox-style&#039;,&lt;br /&gt;
			image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		move = {&lt;br /&gt;
			class = &#039;ombox-move&#039;,&lt;br /&gt;
			image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		protection = {&lt;br /&gt;
			class = &#039;ombox-protection&#039;,&lt;br /&gt;
			image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		notice = {&lt;br /&gt;
			class = &#039;ombox-notice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		note = {&lt;br /&gt;
			class = &#039;ombox-notice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	default              = &#039;notice&#039;,&lt;br /&gt;
	showInvalidTypeError = true,&lt;br /&gt;
	classes              = {&#039;ombox&#039;},&lt;br /&gt;
	usePlainlinksParam   = true,&lt;br /&gt;
	allowSmall           = true,&lt;br /&gt;
	imageEmptyCell       = true,&lt;br /&gt;
	imageRightNone       = true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local tmbox = {&lt;br /&gt;
	types = {&lt;br /&gt;
		speedy = {&lt;br /&gt;
			class = &#039;tmbox-speedy&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		delete = {&lt;br /&gt;
			class = &#039;tmbox-delete&#039;,&lt;br /&gt;
			image = &#039;Ambox warning pn.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		content = {&lt;br /&gt;
			class = &#039;tmbox-content&#039;,&lt;br /&gt;
			image = &#039;Ambox important.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		style = {&lt;br /&gt;
			class = &#039;tmbox-style&#039;,&lt;br /&gt;
			image = &#039;Edit-clear.svg &#039;&lt;br /&gt;
		},&lt;br /&gt;
		move = {&lt;br /&gt;
			class = &#039;tmbox-move&#039;,&lt;br /&gt;
			image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		protection = {&lt;br /&gt;
			class = &#039;tmbox-protection&#039;,&lt;br /&gt;
			image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
		},&lt;br /&gt;
		notice = {&lt;br /&gt;
			class = &#039;tmbox-notice&#039;,&lt;br /&gt;
			image = &#039;Information icon4.svg&#039;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	default              = &#039;notice&#039;,&lt;br /&gt;
	showInvalidTypeError = true,&lt;br /&gt;
	classes              = {&#039;tmbox&#039;},&lt;br /&gt;
	usePlainlinksParam   = true,&lt;br /&gt;
	allowId              = true,&lt;br /&gt;
	allowSmall           = true,&lt;br /&gt;
	imageRightNone       = true,&lt;br /&gt;
	imageEmptyCell       = true,&lt;br /&gt;
	imageEmptyCellStyle  = true,&lt;br /&gt;
	templateCategory     = &#039;討論訊息模板&#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	ambox = ambox,&lt;br /&gt;
	cmbox = cmbox,&lt;br /&gt;
	fmbox = fmbox,&lt;br /&gt;
	imbox = imbox,&lt;br /&gt;
	ombox = ombox,&lt;br /&gt;
	tmbox = tmbox&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;diff=460</id>
		<title>模块:Message box</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;diff=460"/>
		<updated>2025-09-28T15:21:24Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This is a meta-module for producing message box templates, including {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.&lt;br /&gt;
&lt;br /&gt;
-- Require necessary modules.&lt;br /&gt;
local getArgs = require(&#039;Module:Arguments&#039;).getArgs&lt;br /&gt;
local categoryHandler = require(&#039;Module:Category handler&#039;).main&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&lt;br /&gt;
&lt;br /&gt;
-- Load the configuration page.&lt;br /&gt;
local cfgTables = mw.loadData(&#039;Module:Message box/configuration&#039;)&lt;br /&gt;
&lt;br /&gt;
-- Get a language object for formatDate and ucfirst.&lt;br /&gt;
local lang = mw.language.getContentLanguage()&lt;br /&gt;
&lt;br /&gt;
-- Set aliases for often-used functions to reduce table lookups.&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
local tinsert = table.insert&lt;br /&gt;
local tconcat = table.concat&lt;br /&gt;
local trim = mw.text.trim&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function getTitleObject(page, ...)&lt;br /&gt;
	if type(page) == &#039;string&#039; then&lt;br /&gt;
		-- Get the title object, passing the function through pcall &lt;br /&gt;
		-- in case we are over the expensive function count limit.&lt;br /&gt;
		local success, title = pcall(mw.title.new, page, ...)&lt;br /&gt;
		if success then&lt;br /&gt;
			return title&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function union(t1, t2)&lt;br /&gt;
	-- Returns the union of two arrays.&lt;br /&gt;
	local vals = {}&lt;br /&gt;
	for i, v in ipairs(t1) do&lt;br /&gt;
		vals[v] = true&lt;br /&gt;
	end&lt;br /&gt;
	for i, v in ipairs(t2) do&lt;br /&gt;
		vals[v] = true&lt;br /&gt;
	end&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for k in pairs(vals) do&lt;br /&gt;
		tinsert(ret, k)&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(ret)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getArgNums(args, prefix)&lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		local num = mw.ustring.match(tostring(k), &#039;^&#039; .. prefix .. &#039;([1-9]%d*)$&#039;)&lt;br /&gt;
		if num then&lt;br /&gt;
			tinsert(nums, tonumber(num))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(nums)&lt;br /&gt;
	return nums&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Box class definition&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local box = {}&lt;br /&gt;
box.__index = box&lt;br /&gt;
&lt;br /&gt;
function box.new()&lt;br /&gt;
	local obj = {}&lt;br /&gt;
	setmetatable(obj, box)&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box.getNamespaceId(ns)&lt;br /&gt;
	if not ns then return end&lt;br /&gt;
	if type(ns) == &#039;string&#039; then&lt;br /&gt;
		ns = lang:ucfirst(mw.ustring.lower(ns))&lt;br /&gt;
		if ns == &#039;Main&#039; then&lt;br /&gt;
			ns = 0&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local nsTable = mw.site.namespaces[ns]&lt;br /&gt;
	if nsTable then&lt;br /&gt;
		return nsTable.id&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box.getMboxType(nsid)&lt;br /&gt;
	-- Gets the mbox type from a namespace number.&lt;br /&gt;
	if nsid == 0 then&lt;br /&gt;
		return &#039;ambox&#039; -- main namespace&lt;br /&gt;
	elseif nsid == 6 then&lt;br /&gt;
		return &#039;imbox&#039; -- file namespace&lt;br /&gt;
	elseif nsid == 14 then&lt;br /&gt;
		return &#039;cmbox&#039; -- category namespace&lt;br /&gt;
	else&lt;br /&gt;
		local nsTable = mw.site.namespaces[nsid]&lt;br /&gt;
		if nsTable and nsTable.isTalk then&lt;br /&gt;
			return &#039;tmbox&#039; -- any talk namespace&lt;br /&gt;
		else&lt;br /&gt;
			return &#039;ombox&#039; -- other namespaces or invalid input&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:addCat(ns, cat, sort)&lt;br /&gt;
	if type(cat) ~= &#039;string&#039; then return end&lt;br /&gt;
	local nsVals = {&#039;main&#039;, &#039;template&#039;, &#039;all&#039;}&lt;br /&gt;
	local tname&lt;br /&gt;
	for i, val in ipairs(nsVals) do&lt;br /&gt;
		if ns == val then&lt;br /&gt;
			tname = ns .. &#039;Cats&#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if not tname then&lt;br /&gt;
		for i, val in ipairs(nsVals) do&lt;br /&gt;
			nsVals[i] = format(&#039;&amp;quot;%s&amp;quot;&#039;, val)&lt;br /&gt;
		end&lt;br /&gt;
		error(&#039;無效的ns參數傳送到box:addCat；有效的數值為&#039; .. mw.text.listToText(nsVals, &#039;、&#039;, &#039;或&#039;))&lt;br /&gt;
	end&lt;br /&gt;
	self[tname] = self[tname] or {}&lt;br /&gt;
	if type(sort) == &#039;string&#039; then&lt;br /&gt;
		tinsert(self[tname], format(&#039;[[Category:%s|%s]]&#039;, cat, sort))&lt;br /&gt;
	else&lt;br /&gt;
		tinsert(self[tname], format(&#039;[[Category:%s]]&#039;, cat))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:addClass(class)&lt;br /&gt;
	if type(class) ~= &#039;string&#039; then return end&lt;br /&gt;
	self.classes = self.classes or {}&lt;br /&gt;
	tinsert(self.classes, class)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:setTitle(args)&lt;br /&gt;
	-- Get the title object and the namespace.&lt;br /&gt;
	self.pageTitle = getTitleObject(args.page ~= &#039;&#039; and args.page)&lt;br /&gt;
	self.title = self.pageTitle or mw.title.getCurrentTitle()&lt;br /&gt;
	self.demospace = args.demospace ~= &#039;&#039; and args.demospace or nil&lt;br /&gt;
	self.nsid = box.getNamespaceId(self.demospace) or self.title.namespace&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:getConfig(boxType)&lt;br /&gt;
	-- Get the box config data from the data page.&lt;br /&gt;
	if boxType == &#039;mbox&#039; then&lt;br /&gt;
		boxType = box.getMboxType(self.nsid)&lt;br /&gt;
	end&lt;br /&gt;
	local cfg = cfgTables[boxType]&lt;br /&gt;
	if not cfg then&lt;br /&gt;
		local boxTypes = {}&lt;br /&gt;
		for k, v in pairs(dataTables) do&lt;br /&gt;
			tinsert(boxTypes, format(&#039;&amp;quot;%s&amp;quot;&#039;, k))&lt;br /&gt;
		end&lt;br /&gt;
		tinsert(boxTypes, &#039;&amp;quot;mbox&amp;quot;&#039;)&lt;br /&gt;
		error(format(&#039;無效的訊息框類型「%s」；有效的類型為%s&#039;, tostring(boxType), mw.text.listToText(boxTypes)), 2)&lt;br /&gt;
	end&lt;br /&gt;
	return cfg&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:removeBlankArgs(cfg, args)&lt;br /&gt;
	-- Only allow blank arguments for the parameter names listed in cfg.allowBlankParams.&lt;br /&gt;
	local newArgs = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if v ~= &#039;&#039; then&lt;br /&gt;
			newArgs[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	for i, param in ipairs(cfg.allowBlankParams or {}) do&lt;br /&gt;
		newArgs[param] = args[param]&lt;br /&gt;
	end&lt;br /&gt;
	return newArgs&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:setBoxParameters(cfg, args)&lt;br /&gt;
	-- Get type data.&lt;br /&gt;
	self.type = args.type&lt;br /&gt;
	local typeData = cfg.types[self.type]&lt;br /&gt;
	self.invalidTypeError = cfg.showInvalidTypeError and self.type and not typeData and true or false&lt;br /&gt;
	typeData = typeData or cfg.types[cfg.default]&lt;br /&gt;
	self.typeClass = typeData.class&lt;br /&gt;
	self.typeImage = typeData.image&lt;br /&gt;
&lt;br /&gt;
	-- Find if the box has been wrongly substituted.&lt;br /&gt;
	if cfg.substCheck and args.subst == &#039;SUBST&#039; then&lt;br /&gt;
		self.isSubstituted = true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Find whether we are using a small message box.&lt;br /&gt;
	if cfg.allowSmall and (&lt;br /&gt;
		cfg.smallParam and args.small == cfg.smallParam&lt;br /&gt;
		or not cfg.smallParam and yesno(args.small)&lt;br /&gt;
	)&lt;br /&gt;
	then&lt;br /&gt;
		self.isSmall = true&lt;br /&gt;
	else&lt;br /&gt;
		self.isSmall = false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add attributes, classes and styles.&lt;br /&gt;
	if cfg.allowId then&lt;br /&gt;
		self.id = args.id&lt;br /&gt;
		self.name = args.name&lt;br /&gt;
		if self.name then&lt;br /&gt;
			self:addClass(&#039;box-&#039; .. string.gsub(self.name,&#039; &#039;,&#039;_&#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	self:addClass(cfg.usePlainlinksParam and yesno(args.plainlinks or true) and &#039;plainlinks&#039;)&lt;br /&gt;
	for _, class in ipairs(cfg.classes or {}) do&lt;br /&gt;
		self:addClass(class)&lt;br /&gt;
	end&lt;br /&gt;
	if self.isSmall then&lt;br /&gt;
		self:addClass(cfg.smallClass or &#039;mbox-small&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if yesno(args.hidden) then&lt;br /&gt;
		self:addClass(&#039;infobox editsection&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	self:addClass(self.typeClass)&lt;br /&gt;
	self:addClass(args.class)&lt;br /&gt;
	self.style = args.style&lt;br /&gt;
&lt;br /&gt;
	-- Set text style.&lt;br /&gt;
	self.textstyle = args.textstyle&lt;br /&gt;
&lt;br /&gt;
	-- Find if we are on the template page or not. This functionality is only used if useCollapsibleTextFields is set,&lt;br /&gt;
	-- or if both cfg.templateCategory and cfg.templateCategoryRequireName are set.&lt;br /&gt;
	self.useCollapsibleTextFields = cfg.useCollapsibleTextFields&lt;br /&gt;
	if self.useCollapsibleTextFields or cfg.templateCategory and cfg.templateCategoryRequireName then&lt;br /&gt;
		self.name = args.name&lt;br /&gt;
		if self.name then&lt;br /&gt;
			local templateName = mw.ustring.match(self.name, &#039;^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$&#039;) or self.name&lt;br /&gt;
			templateName = &#039;Template:&#039; .. templateName&lt;br /&gt;
			self.templateTitle = getTitleObject(templateName)&lt;br /&gt;
		end&lt;br /&gt;
		self.isTemplatePage = self.templateTitle and mw.title.equals(self.title, self.templateTitle) or false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Process data for collapsible text fields. At the moment these are only used in {{ambox}}.&lt;br /&gt;
	if self.useCollapsibleTextFields then&lt;br /&gt;
		-- Get the self.issue value.&lt;br /&gt;
		if self.isSmall and args.smalltext then&lt;br /&gt;
			self.issue = args.smalltext&lt;br /&gt;
		else&lt;br /&gt;
			local sect&lt;br /&gt;
			if args.sect == &#039;&#039; then&lt;br /&gt;
				sect = &#039;此&#039; .. (cfg.sectionDefault or &#039;頁面&#039;)&lt;br /&gt;
			elseif type(args.sect) == &#039;string&#039; then&lt;br /&gt;
				sect = &#039;此&#039; .. args.sect&lt;br /&gt;
			end&lt;br /&gt;
			local issue = args.issue&lt;br /&gt;
			issue = type(issue) == &#039;string&#039; and issue ~= &#039;&#039; and issue or nil&lt;br /&gt;
			local text = args.text&lt;br /&gt;
			text = type(text) == &#039;string&#039; and text or nil&lt;br /&gt;
			local issues = {}&lt;br /&gt;
			tinsert(issues, sect)&lt;br /&gt;
			tinsert(issues, issue)&lt;br /&gt;
			tinsert(issues, text)&lt;br /&gt;
			self.issue = tconcat(issues)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- Get the self.talk value.&lt;br /&gt;
		local talk = args.talk&lt;br /&gt;
		if talk == &#039;&#039; -- Show talk links on the template page or template subpages if the talk parameter is blank.&lt;br /&gt;
			and self.templateTitle &lt;br /&gt;
			and (mw.title.equals(self.templateTitle, self.title) or self.title:isSubpageOf(self.templateTitle))&lt;br /&gt;
		then&lt;br /&gt;
			talk = &#039;#&#039;&lt;br /&gt;
		elseif talk == &#039;&#039; then&lt;br /&gt;
			talk = nil&lt;br /&gt;
		end&lt;br /&gt;
		if talk then&lt;br /&gt;
			-- If the talk value is a talk page, make a link to that page. Else assume that it&#039;s a section heading,&lt;br /&gt;
			-- and make a link to the talk page of the current page with that section heading.&lt;br /&gt;
			local talkTitle = getTitleObject(talk)&lt;br /&gt;
			local talkArgIsTalkPage = true&lt;br /&gt;
			if not talkTitle or not talkTitle.isTalkPage then&lt;br /&gt;
				talkArgIsTalkPage = false&lt;br /&gt;
				talkTitle = getTitleObject(self.title.text, mw.site.namespaces[self.title.namespace].talk.id)&lt;br /&gt;
			end&lt;br /&gt;
			if talkTitle and talkTitle.exists then&lt;br /&gt;
				local talkText = &#039;相關討論可見於&#039;&lt;br /&gt;
				if talkArgIsTalkPage then&lt;br /&gt;
					talkText = format(&#039;%s[[%s|%s]].&#039;, talkText, talk, talkTitle.prefixedText)&lt;br /&gt;
				else&lt;br /&gt;
					talkText = format(&#039;%s[[%s#%s|討論頁]].&#039;, talkText, talkTitle.prefixedText, talk)&lt;br /&gt;
				end&lt;br /&gt;
				self.talk = talkText&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- Get other values.&lt;br /&gt;
		local date&lt;br /&gt;
		if args.date and args.date ~= &#039;&#039; then&lt;br /&gt;
			date = args.date&lt;br /&gt;
		elseif args.time == &#039;&#039; and self.isTemplatePage then&lt;br /&gt;
			date = lang:formatDate(&#039;Y年n月j日&#039;)&lt;br /&gt;
		elseif args.time and args.time ~= &#039;&#039; then&lt;br /&gt;
			date = lang:formatDate(&#039;Y年n月j日&#039;, args.time)&lt;br /&gt;
		end&lt;br /&gt;
		if date then&lt;br /&gt;
			local ok, tempdate = pcall(lang.formatDate, lang, &#039;Y年n月j日&#039;, date) -- 正規化日期&lt;br /&gt;
			if ok then&lt;br /&gt;
				date = tempdate&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if date then&lt;br /&gt;
			self.date = string.format(&amp;quot; &amp;lt;small class=&#039;date-container&#039;&amp;gt;&#039;&#039;(&amp;lt;span class=&#039;date&#039;&amp;gt;%s&amp;lt;/span&amp;gt;)&#039;&#039;&amp;lt;/small&amp;gt;&amp;quot;, date)&lt;br /&gt;
		end&lt;br /&gt;
		if args.fix and args.fix ~= &#039;&#039; then&lt;br /&gt;
			self.fix = format(&amp;quot;&amp;lt;br /&amp;gt;&amp;lt;small&amp;gt;%s&amp;lt;/small&amp;gt;&amp;quot;, args.fix)&lt;br /&gt;
		else&lt;br /&gt;
			self.fix = &#039;&#039;&lt;br /&gt;
		end&lt;br /&gt;
		self.info = args.info&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the non-collapsible text field. At the moment this is used by all box types other than ambox,&lt;br /&gt;
	-- and also by ambox when small=yes.&lt;br /&gt;
	if self.isSmall then&lt;br /&gt;
		self.text = args.smalltext or args.text&lt;br /&gt;
	else&lt;br /&gt;
		self.text = args.text&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the below row.&lt;br /&gt;
	self.below = cfg.below and args.below&lt;br /&gt;
&lt;br /&gt;
	-- General image settings.&lt;br /&gt;
	self.imageCellDiv = not self.isSmall and cfg.imageCellDiv and true or false&lt;br /&gt;
	self.imageEmptyCell = cfg.imageEmptyCell&lt;br /&gt;
	if cfg.imageEmptyCellStyle then&lt;br /&gt;
		self.imageEmptyCellStyle = &#039;border:none;padding:0px;width:1px&#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Left image settings.&lt;br /&gt;
	local imageLeft = self.isSmall and args.smallimage or args.image&lt;br /&gt;
	if cfg.imageCheckBlank and imageLeft ~= &#039;blank&#039; and imageLeft ~= &#039;none&#039;&lt;br /&gt;
		or not cfg.imageCheckBlank and imageLeft ~= &#039;none&#039;&lt;br /&gt;
	then&lt;br /&gt;
		self.imageLeft = imageLeft&lt;br /&gt;
		if not imageLeft then&lt;br /&gt;
			local imageSize = self.isSmall and (cfg.imageSmallSize or &#039;30x30px&#039;) or &#039;40x40px&#039;&lt;br /&gt;
			self.imageLeft = format(&#039;[[File:%s|%s|link=|alt=]]&#039;, self.typeImage or &#039;Imbox notice.png&#039;, imageSize)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Right image settings.&lt;br /&gt;
	local imageRight = self.isSmall and args.smallimageright or args.imageright&lt;br /&gt;
	if not (cfg.imageRightNone and imageRight == &#039;none&#039;) then&lt;br /&gt;
		self.imageRight = imageRight&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add mainspace categories. At the moment these are only used in {{ambox}}.&lt;br /&gt;
	if cfg.allowMainspaceCategories then&lt;br /&gt;
		if args.cat then&lt;br /&gt;
			args.cat1 = args.cat&lt;br /&gt;
		end&lt;br /&gt;
		self.catNums = getArgNums(args, &#039;cat&#039;)&lt;br /&gt;
		if args.category then&lt;br /&gt;
			args.category1 = args.category&lt;br /&gt;
		end&lt;br /&gt;
		self.categoryNums = getArgNums(args, &#039;category&#039;)&lt;br /&gt;
		if args.all then&lt;br /&gt;
			args.all1 = args.all&lt;br /&gt;
		end&lt;br /&gt;
		self.allNums = getArgNums(args, &#039;all&#039;)&lt;br /&gt;
		self.categoryParamNums = union(self.catNums, self.categoryNums)&lt;br /&gt;
		self.categoryParamNums = union(self.categoryParamNums, self.allNums)&lt;br /&gt;
		-- The following is roughly equivalent to the old {{Ambox/category}}.&lt;br /&gt;
		local date&lt;br /&gt;
		local sortDay&lt;br /&gt;
		local dayName = {&lt;br /&gt;
			[1] = &#039;㏠&#039;,&lt;br /&gt;
			[2] = &#039;㏡&#039;,&lt;br /&gt;
			[3] = &#039;㏢&#039;,&lt;br /&gt;
			[4] = &#039;㏣&#039;,&lt;br /&gt;
			[5] = &#039;㏤&#039;,&lt;br /&gt;
			[6] = &#039;㏥&#039;,&lt;br /&gt;
			[7] = &#039;㏦&#039;,&lt;br /&gt;
			[8] = &#039;㏧&#039;,&lt;br /&gt;
			[9] = &#039;㏨&#039;,&lt;br /&gt;
			[10] = &#039;㏩&#039;,&lt;br /&gt;
			[11] = &#039;㏪&#039;,&lt;br /&gt;
			[12] = &#039;㏫&#039;,&lt;br /&gt;
			[13] = &#039;㏬&#039;,&lt;br /&gt;
			[14] = &#039;㏭&#039;,&lt;br /&gt;
			[15] = &#039;㏮&#039;,&lt;br /&gt;
			[16] = &#039;㏯&#039;,&lt;br /&gt;
			[17] = &#039;㏰&#039;,&lt;br /&gt;
			[18] = &#039;㏱&#039;,&lt;br /&gt;
			[19] = &#039;㏲&#039;,&lt;br /&gt;
			[20] = &#039;㏳&#039;,&lt;br /&gt;
			[21] = &#039;㏴&#039;,&lt;br /&gt;
			[22] = &#039;㏵&#039;,&lt;br /&gt;
			[23] = &#039;㏶&#039;,&lt;br /&gt;
			[24] = &#039;㏷&#039;,&lt;br /&gt;
			[25] = &#039;㏸&#039;,&lt;br /&gt;
			[26] = &#039;㏹&#039;,&lt;br /&gt;
			[27] = &#039;㏺&#039;,&lt;br /&gt;
			[28] = &#039;㏻&#039;,&lt;br /&gt;
			[29] = &#039;㏼&#039;,&lt;br /&gt;
			[30] = &#039;㏽&#039;,&lt;br /&gt;
			[31] = &#039;㏾&#039;&lt;br /&gt;
		}&lt;br /&gt;
		if args.date and args.date ~= &#039;&#039; then&lt;br /&gt;
			date = args.date&lt;br /&gt;
			local ok, tempdate = pcall(lang.formatDate, lang, &#039;Y年n月&#039;, date) -- 正規化日期&lt;br /&gt;
			if ok then&lt;br /&gt;
				date = tempdate&lt;br /&gt;
			end&lt;br /&gt;
		elseif args.time and args.time ~= &#039;&#039; then&lt;br /&gt;
			date = lang:formatDate(&#039;Y年n月&#039;, args.time)&lt;br /&gt;
			sortDay = lang:formatDate(&#039;j&#039;, args.time)&lt;br /&gt;
			sortDay = tonumber(sortDay)&lt;br /&gt;
			sortDay = dayName[sortDay]&lt;br /&gt;
		end&lt;br /&gt;
		date = type(date) == &#039;string&#039; and date&lt;br /&gt;
		local preposition = &#039;自&#039;&lt;br /&gt;
		for _, num in ipairs(self.categoryParamNums) do&lt;br /&gt;
			local mainCat = args[&#039;cat&#039; .. tostring(num)] or args[&#039;category&#039; .. tostring(num)]&lt;br /&gt;
			local allCat = args[&#039;all&#039; .. tostring(num)]&lt;br /&gt;
			mainCat = type(mainCat) == &#039;string&#039; and mainCat&lt;br /&gt;
			allCat = type(allCat) == &#039;string&#039; and allCat&lt;br /&gt;
			if mainCat and date and date ~= &#039;&#039; then&lt;br /&gt;
				local catTitle = format(&#039;%s%s%s&#039;, preposition, date, mainCat)&lt;br /&gt;
				if sortDay then&lt;br /&gt;
					self:addCat(&#039;main&#039;, catTitle, sortDay)&lt;br /&gt;
				else&lt;br /&gt;
					self:addCat(&#039;main&#039;, catTitle)&lt;br /&gt;
				end&lt;br /&gt;
				catTitle = getTitleObject(&#039;Category:&#039; .. catTitle)&lt;br /&gt;
				if not catTitle or not catTitle.exists then&lt;br /&gt;
					self:addCat(&#039;main&#039;, &#039;模板中使用无效日期参数的条目&#039;)&lt;br /&gt;
				end&lt;br /&gt;
			elseif mainCat and (not date or date == &#039;&#039;) then&lt;br /&gt;
				self:addCat(&#039;main&#039;, mainCat)&lt;br /&gt;
			end&lt;br /&gt;
			if allCat then&lt;br /&gt;
				self:addCat(&#039;main&#039;, allCat)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add template-namespace categories.&lt;br /&gt;
	if cfg.templateCategory then&lt;br /&gt;
		if cfg.templateCategoryRequireName then&lt;br /&gt;
			if self.isTemplatePage then&lt;br /&gt;
				self:addCat(&#039;template&#039;, cfg.templateCategory)&lt;br /&gt;
			end&lt;br /&gt;
		elseif not self.title.isSubpage then&lt;br /&gt;
			self:addCat(&#039;template&#039;, cfg.templateCategory)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add template error category.&lt;br /&gt;
	if cfg.templateErrorCategory then&lt;br /&gt;
		local templateErrorCategory = cfg.templateErrorCategory&lt;br /&gt;
		local templateCat, templateSort&lt;br /&gt;
		if not self.name and not self.title.isSubpage then&lt;br /&gt;
			templateCat = templateErrorCategory&lt;br /&gt;
		elseif self.isTemplatePage then&lt;br /&gt;
			local paramsToCheck = cfg.templateErrorParamsToCheck or {}&lt;br /&gt;
			local count = 0&lt;br /&gt;
			for i, param in ipairs(paramsToCheck) do&lt;br /&gt;
				if not args[param] then&lt;br /&gt;
					count = count + 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if count &amp;gt; 0 then&lt;br /&gt;
				templateCat = templateErrorCategory&lt;br /&gt;
				templateSort = tostring(count)&lt;br /&gt;
			end&lt;br /&gt;
			if self.categoryNums and #self.categoryNums &amp;gt; 0 then&lt;br /&gt;
				templateCat = templateErrorCategory&lt;br /&gt;
				templateSort = &#039;C&#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		self:addCat(&#039;template&#039;, templateCat, templateSort)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Categories for all namespaces.&lt;br /&gt;
	if self.invalidTypeError then&lt;br /&gt;
		local allSort = (self.nsid == 0 and &#039;Main:&#039; or &#039;&#039;) .. self.title.prefixedText&lt;br /&gt;
		self:addCat(&#039;all&#039;, &#039;需要修复的信息框&#039;, allSort)&lt;br /&gt;
	end&lt;br /&gt;
	if self.isSubstituted then&lt;br /&gt;
		self:addCat(&#039;all&#039;, &#039;錯誤使用替換引用的頁面&#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Convert category tables to strings and pass them through [[Module:Category handler]].&lt;br /&gt;
	self.categories = categoryHandler{&lt;br /&gt;
		main = tconcat(self.mainCats or {}),&lt;br /&gt;
		template = tconcat(self.templateCats or {}),&lt;br /&gt;
		all = tconcat(self.allCats or {}),&lt;br /&gt;
		nocat = args.nocat,&lt;br /&gt;
		demospace = self.demospace,&lt;br /&gt;
		page = self.pageTitle and self.pageTitle.prefixedText or nil&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:export()&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
	-- Add the subst check error.&lt;br /&gt;
	if self.isSubstituted and self.name then&lt;br /&gt;
		root&lt;br /&gt;
			:tag(&#039;b&#039;)&lt;br /&gt;
				:addClass(&#039;error&#039;)&lt;br /&gt;
				:wikitext(format(&lt;br /&gt;
					&#039;模板&amp;lt;code&amp;gt;%s[[Template:%s|%s]]%s&amp;lt;/code&amp;gt;被錯誤地替代。&#039;,&lt;br /&gt;
					mw.text.nowiki(&#039;{{&#039;), self.name, self.name, mw.text.nowiki(&#039;}}&#039;)&lt;br /&gt;
				))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create the box table.&lt;br /&gt;
	local boxTable = root:tag(&#039;table&#039;)&lt;br /&gt;
	boxTable&lt;br /&gt;
		:attr(&#039;id&#039;, self.id)&lt;br /&gt;
	for i, class in ipairs(self.classes or {}) do&lt;br /&gt;
		boxTable&lt;br /&gt;
			:addClass(class)&lt;br /&gt;
	end&lt;br /&gt;
	boxTable&lt;br /&gt;
		:cssText(self.style)&lt;br /&gt;
		:attr(&#039;role&#039;, &#039;presentation&#039;)&lt;br /&gt;
&lt;br /&gt;
	-- Add the left-hand image.&lt;br /&gt;
	local row = boxTable:tag(&#039;tr&#039;)&lt;br /&gt;
	if self.imageLeft then&lt;br /&gt;
		local imageLeftCell = row:tag(&#039;td&#039;):addClass(&#039;mbox-image&#039;)&lt;br /&gt;
		if self.imageCellDiv then&lt;br /&gt;
			-- If we are using a div, redefine imageLeftCell so that the image is inside it.&lt;br /&gt;
			-- Divs use style=&amp;quot;width: 52px;&amp;quot;, which limits the image width to 52px. If any&lt;br /&gt;
			-- images in a div are wider than that, they may overlap with the text or cause&lt;br /&gt;
			-- other display problems.&lt;br /&gt;
			imageLeftCell = imageLeftCell:tag(&#039;div&#039;):css(&#039;width&#039;, &#039;52px&#039;) &lt;br /&gt;
		end&lt;br /&gt;
		imageLeftCell&lt;br /&gt;
			:wikitext(self.imageLeft)&lt;br /&gt;
	elseif self.imageEmptyCell then&lt;br /&gt;
		-- Some message boxes define an empty cell if no image is specified, and some don&#039;t.&lt;br /&gt;
		-- The old template code in templates where empty cells are specified gives the following hint:&lt;br /&gt;
		-- &amp;quot;No image. Cell with some width or padding necessary for text cell to have 100% width.&amp;quot;&lt;br /&gt;
		row:tag(&#039;td&#039;)&lt;br /&gt;
			:addClass(&#039;mbox-empty-cell&#039;) &lt;br /&gt;
			:cssText(self.imageEmptyCellStyle)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the text.&lt;br /&gt;
	local textCell = row:tag(&#039;td&#039;):addClass(&#039;mbox-text&#039;)&lt;br /&gt;
	if self.useCollapsibleTextFields then&lt;br /&gt;
		-- The message box uses advanced text parameters that allow things to be collapsible. At the&lt;br /&gt;
		-- moment, only ambox uses this.&lt;br /&gt;
		textCell&lt;br /&gt;
			:cssText(self.textstyle)&lt;br /&gt;
		local textCellSpan = textCell:tag(&#039;div&#039;)&lt;br /&gt;
		textCellSpan&lt;br /&gt;
			:addClass(&#039;mbox-text-span&#039;)&lt;br /&gt;
			:wikitext(self.issue)&lt;br /&gt;
		if not self.isSmall then&lt;br /&gt;
			textCellSpan&lt;br /&gt;
				:tag(&#039;span&#039;)&lt;br /&gt;
					:addClass(&#039;hide-when-compact&#039;)&lt;br /&gt;
					:wikitext(self.talk and self.talk)&lt;br /&gt;
		end&lt;br /&gt;
		textCellSpan&lt;br /&gt;
			:wikitext(self.date and self.date)&lt;br /&gt;
		if not self.isSmall and self.fix ~= &#039;&#039; then&lt;br /&gt;
			textCellSpan&lt;br /&gt;
				:tag(&#039;span&#039;)&lt;br /&gt;
					:addClass(&#039;hide-when-compact&#039;)&lt;br /&gt;
					:wikitext(self.fix and self.fix)&lt;br /&gt;
		end&lt;br /&gt;
		if not self.isSmall then&lt;br /&gt;
			textCellSpan&lt;br /&gt;
				:tag(&#039;span&#039;)&lt;br /&gt;
				:addClass(&#039;hide-when-compact&#039;)&lt;br /&gt;
				:wikitext(self.info and self.info)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- Default text formatting - anything goes.&lt;br /&gt;
		textCell&lt;br /&gt;
			:cssText(self.textstyle)&lt;br /&gt;
			:wikitext(self.text)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the right-hand image.&lt;br /&gt;
	if self.imageRight then&lt;br /&gt;
		local imageRightCell = row:tag(&#039;td&#039;):addClass(&#039;mbox-imageright&#039;)&lt;br /&gt;
		if self.imageCellDiv then&lt;br /&gt;
			imageRightCell = imageRightCell:tag(&#039;div&#039;):css(&#039;width&#039;, &#039;52px&#039;) -- If we are using a div, redefine imageRightCell so that the image is inside it.&lt;br /&gt;
		end&lt;br /&gt;
		imageRightCell&lt;br /&gt;
			:wikitext(self.imageRight)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the below row.&lt;br /&gt;
	if self.below then&lt;br /&gt;
		boxTable:tag(&#039;tr&#039;)&lt;br /&gt;
			:tag(&#039;td&#039;)&lt;br /&gt;
				:attr(&#039;colspan&#039;, self.imageRight and &#039;3&#039; or &#039;2&#039;)&lt;br /&gt;
				:addClass(&#039;mbox-text&#039;)&lt;br /&gt;
				:cssText(self.textstyle)&lt;br /&gt;
				:wikitext(self.below)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add error message for invalid type parameters.&lt;br /&gt;
	if self.invalidTypeError then&lt;br /&gt;
		root&lt;br /&gt;
			:tag(&#039;div&#039;)&lt;br /&gt;
				:css(&#039;text-align&#039;, &#039;center&#039;)&lt;br /&gt;
				:wikitext(format(&#039;此訊息框使用無效的「type=%s」參數，需要修復。&#039;, self.type or &#039;&#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add categories.&lt;br /&gt;
	root&lt;br /&gt;
		:wikitext(self.categories)&lt;br /&gt;
&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function main(boxType, args)&lt;br /&gt;
	local outputBox = box.new()&lt;br /&gt;
	outputBox:setTitle(args)&lt;br /&gt;
	local cfg = outputBox:getConfig(boxType)&lt;br /&gt;
	args = outputBox:removeBlankArgs(cfg, args)&lt;br /&gt;
	outputBox:setBoxParameters(cfg, args)&lt;br /&gt;
	return outputBox:export()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeWrapper(boxType)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {trim = false, removeBlanks = false})&lt;br /&gt;
		return main(boxType, args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local p = {&lt;br /&gt;
	main = main,&lt;br /&gt;
	mbox = makeWrapper(&#039;mbox&#039;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for boxType in pairs(cfgTables) do&lt;br /&gt;
	p[boxType] = makeWrapper(boxType)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Mbox&amp;diff=458</id>
		<title>模板:Mbox</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Mbox&amp;diff=458"/>
		<updated>2025-09-28T15:21:24Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:Message box|mbox}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Reflist&amp;diff=456</id>
		<title>模板:Reflist</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Reflist&amp;diff=456"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;reflist &amp;lt;!--&lt;br /&gt;
 --&amp;gt;{{#if: {{{1|}}}&lt;br /&gt;
    | columns {{#iferror: {{#ifexpr: {{{1|1}}} &amp;gt; 1 }}&lt;br /&gt;
      | references-column-width &lt;br /&gt;
      | references-column-count references-column-count-{{#if:1|{{{1}}}}} }}&lt;br /&gt;
    | {{#if: {{{colwidth|}}}&lt;br /&gt;
      | references-column-width }} }}&amp;quot; style=&amp;quot;&amp;lt;!--&lt;br /&gt;
 --&amp;gt;{{#if: {{{1|}}}&lt;br /&gt;
    | {{#iferror: {{#ifexpr: {{{1|1}}} &amp;gt; 1 }}&lt;br /&gt;
      | {{column-width|{{#if:1|{{{1}}}}}}}&lt;br /&gt;
      | {{column-count|{{#if:1|{{{1}}}}}}} }}&lt;br /&gt;
    | {{#if: {{{colwidth|}}}&lt;br /&gt;
      | {{column-width|{{{colwidth}}}}} }} }} list-style-type: &amp;lt;!--&lt;br /&gt;
 --&amp;gt;{{{liststyle|{{#switch: {{{group|}}}&lt;br /&gt;
    | upper-alpha&lt;br /&gt;
    | upper-roman&lt;br /&gt;
    | lower-alpha&lt;br /&gt;
    | lower-greek&lt;br /&gt;
    | lower-roman = {{{group}}}&lt;br /&gt;
    | #default = decimal}}}}};&amp;quot;&amp;gt;&lt;br /&gt;
{{{list|{{#tag:references|{{{refs|}}}|group={{{group|}}}}}}}}&amp;lt;/div&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_conference&amp;diff=454</id>
		<title>模板:Cite conference</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_conference&amp;diff=454"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=conference&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_book&amp;diff=452</id>
		<title>模板:Cite book</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_book&amp;diff=452"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{pp-template|small=yes}}&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=book&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_journal&amp;diff=450</id>
		<title>模板:Cite journal</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_journal&amp;diff=450"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:Citation/CS1|citation&lt;br /&gt;
|CitationClass=journal&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_news&amp;diff=448</id>
		<title>模板:Cite news</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_news&amp;diff=448"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=news&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_web&amp;diff=446</id>
		<title>模板:Cite web</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Cite_web&amp;diff=446"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{pp-template|small=yes}}&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=web&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Citation&amp;diff=444</id>
		<title>模板:Citation</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Citation&amp;diff=444"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:citation/CS1|citation&lt;br /&gt;
|CitationClass=citation&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Namespace_detect&amp;diff=442</id>
		<title>模块:Namespace detect</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Namespace_detect&amp;diff=442"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--                            NAMESPACE DETECT                                --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module implements the {{namespace detect}} template in Lua, with a    --&lt;br /&gt;
-- few improvements: all namespaces and all namespace aliases are supported,  --&lt;br /&gt;
-- and namespace names are detected automatically for the local wiki. The     --&lt;br /&gt;
-- module can also use the corresponding subject namespace value if it is     --&lt;br /&gt;
-- used on a talk page. Parameter names can be configured for different wikis --&lt;br /&gt;
-- by altering the values in the &amp;quot;cfg&amp;quot; table in                               --&lt;br /&gt;
-- Module:Namespace detect/config.                                            --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local data = mw.loadData(&#039;Module:Namespace detect/data&#039;)&lt;br /&gt;
local argKeys = data.argKeys&lt;br /&gt;
local cfg = data.cfg&lt;br /&gt;
local mappings = data.mappings&lt;br /&gt;
&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&lt;br /&gt;
local mArguments -- Lazily initialise Module:Arguments&lt;br /&gt;
local mTableTools -- Lazily initilalise Module:TableTools&lt;br /&gt;
local ustringLower = mw.ustring.lower&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function fetchValue(t1, t2)&lt;br /&gt;
	-- Fetches a value from the table t1 for the first key in array t2 where&lt;br /&gt;
	-- a non-nil value of t1 exists.&lt;br /&gt;
	for i, key in ipairs(t2) do&lt;br /&gt;
		local value = t1[key]&lt;br /&gt;
		if value ~= nil then&lt;br /&gt;
			return value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function equalsArrayValue(t, value)&lt;br /&gt;
	-- Returns true if value equals a value in the array t. Otherwise&lt;br /&gt;
	-- returns false.&lt;br /&gt;
	for i, arrayValue in ipairs(t) do&lt;br /&gt;
		if value == arrayValue then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getPageObject(page)&lt;br /&gt;
	-- Get the page object, passing the function through pcall in case of&lt;br /&gt;
	-- errors, e.g. being over the expensive function count limit.&lt;br /&gt;
	if page then&lt;br /&gt;
		local success, pageObject = pcall(mw.title.new, page)&lt;br /&gt;
		if success then&lt;br /&gt;
			return pageObject&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provided for backward compatibility with other modules&lt;br /&gt;
function p.getParamMappings()&lt;br /&gt;
	return mappings&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getNamespace(args)&lt;br /&gt;
	-- This function gets the namespace name from the page object.&lt;br /&gt;
	local page = fetchValue(args, argKeys.demopage)&lt;br /&gt;
	if page == &#039;&#039; then&lt;br /&gt;
		page = nil&lt;br /&gt;
	end&lt;br /&gt;
	local demospace = fetchValue(args, argKeys.demospace)&lt;br /&gt;
	if demospace == &#039;&#039; then&lt;br /&gt;
		demospace = nil&lt;br /&gt;
	end&lt;br /&gt;
	local subjectns = fetchValue(args, argKeys.subjectns)&lt;br /&gt;
	local ret&lt;br /&gt;
	if demospace then&lt;br /&gt;
		-- Handle &amp;quot;demospace = main&amp;quot; properly.&lt;br /&gt;
		if equalsArrayValue(argKeys.main, ustringLower(demospace)) then&lt;br /&gt;
			ret = mw.site.namespaces[0].name&lt;br /&gt;
		else&lt;br /&gt;
			ret = demospace&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local pageObject = p.getPageObject(page)&lt;br /&gt;
		if pageObject then&lt;br /&gt;
			if pageObject.isTalkPage then&lt;br /&gt;
				-- Get the subject namespace if the option is set,&lt;br /&gt;
				-- otherwise use &amp;quot;talk&amp;quot;.&lt;br /&gt;
				if yesno(subjectns) then&lt;br /&gt;
					ret = mw.site.namespaces[pageObject.namespace].subject.name&lt;br /&gt;
				else&lt;br /&gt;
					ret = &#039;talk&#039;&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				ret = pageObject.nsText&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return nil -- return nil if the page object doesn&#039;t exist.&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	ret = ret:gsub(&#039;_&#039;, &#039; &#039;)&lt;br /&gt;
	return ustringLower(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	-- Check the parameters stored in the mappings table for any matches.&lt;br /&gt;
	local namespace = getNamespace(args) or &#039;other&#039; -- &amp;quot;other&amp;quot; avoids nil table keys&lt;br /&gt;
	local params = mappings[namespace] or {}&lt;br /&gt;
	local ret = fetchValue(args, params)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- If there were no matches, return parameters for other namespaces.&lt;br /&gt;
	-- This happens if there was no text specified for the namespace that&lt;br /&gt;
	-- was detected or if the demospace parameter is not a valid&lt;br /&gt;
	-- namespace. Note that the parameter for the detected namespace must be&lt;br /&gt;
	-- completely absent for this to happen, not merely blank.&lt;br /&gt;
	--]]&lt;br /&gt;
	if ret == nil then&lt;br /&gt;
		ret = fetchValue(args, argKeys.other)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	mArguments = require(&#039;Module:Arguments&#039;)&lt;br /&gt;
	local args = mArguments.getArgs(frame, {removeBlanks = false})&lt;br /&gt;
	local ret = p._main(args)&lt;br /&gt;
	return ret or &#039;&#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.table(frame)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Create a wikitable of all subject namespace parameters, for&lt;br /&gt;
	-- documentation purposes. The talk parameter is optional, in case it&lt;br /&gt;
	-- needs to be excluded in the documentation.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	-- Load modules and initialise variables.&lt;br /&gt;
	mTableTools = require(&#039;Module:TableTools&#039;)&lt;br /&gt;
	local namespaces = mw.site.namespaces&lt;br /&gt;
	local cfg = data.cfg&lt;br /&gt;
	local useTalk = type(frame) == &#039;table&#039; &lt;br /&gt;
		and type(frame.args) == &#039;table&#039; &lt;br /&gt;
		and yesno(frame.args.talk) -- Whether to use the talk parameter.&lt;br /&gt;
	&lt;br /&gt;
	-- Get the header names.&lt;br /&gt;
	local function checkValue(value, default)&lt;br /&gt;
		if type(value) == &#039;string&#039; then&lt;br /&gt;
			return value&lt;br /&gt;
		else&lt;br /&gt;
			return default&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local nsHeader = checkValue(cfg.wikitableNamespaceHeader, &#039;Namespace&#039;)&lt;br /&gt;
	local aliasesHeader = checkValue(cfg.wikitableAliasesHeader, &#039;Aliases&#039;)&lt;br /&gt;
&lt;br /&gt;
	-- Put the namespaces in order.&lt;br /&gt;
	local mappingsOrdered = {}&lt;br /&gt;
	for nsname, params in pairs(mappings) do&lt;br /&gt;
		if useTalk or nsname ~= &#039;talk&#039; then&lt;br /&gt;
			local nsid = namespaces[nsname].id&lt;br /&gt;
			-- Add 1, as the array must start with 1; nsid 0 would be lost otherwise.&lt;br /&gt;
			nsid = nsid + 1 &lt;br /&gt;
			mappingsOrdered[nsid] = params&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	mappingsOrdered = mTableTools.compressSparseArray(mappingsOrdered)&lt;br /&gt;
&lt;br /&gt;
	-- Build the table.&lt;br /&gt;
	local ret = &#039;{| class=&amp;quot;wikitable&amp;quot;&#039;&lt;br /&gt;
		.. &#039;\n|-&#039;&lt;br /&gt;
		.. &#039;\n! &#039; .. nsHeader&lt;br /&gt;
		.. &#039;\n! &#039; .. aliasesHeader&lt;br /&gt;
	for i, params in ipairs(mappingsOrdered) do&lt;br /&gt;
		for j, param in ipairs(params) do&lt;br /&gt;
			if j == 1 then&lt;br /&gt;
				ret = ret .. &#039;\n|-&#039;&lt;br /&gt;
					.. &#039;\n| &amp;lt;code&amp;gt;&#039; .. param .. &#039;&amp;lt;/code&amp;gt;&#039;&lt;br /&gt;
					.. &#039;\n| &#039;&lt;br /&gt;
			elseif j == 2 then&lt;br /&gt;
				ret = ret .. &#039;&amp;lt;code&amp;gt;&#039; .. param .. &#039;&amp;lt;/code&amp;gt;&#039;&lt;br /&gt;
			else&lt;br /&gt;
				ret = ret .. &#039;, &amp;lt;code&amp;gt;&#039; .. param .. &#039;&amp;lt;/code&amp;gt;&#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	ret = ret .. &#039;\n|-&#039;&lt;br /&gt;
		.. &#039;\n|}&#039;&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Error&amp;diff=440</id>
		<title>模块:Error</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Error&amp;diff=440"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{error}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._error(args)&lt;br /&gt;
    local tag = mw.ustring.lower(tostring(args.tag))&lt;br /&gt;
&lt;br /&gt;
    -- Work out what html tag we should use.&lt;br /&gt;
    if not (tag == &#039;p&#039; or tag == &#039;span&#039; or tag == &#039;div&#039;) then&lt;br /&gt;
        tag = &#039;strong&#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Generate the html.&lt;br /&gt;
    return tostring(mw.html.create(tag)&lt;br /&gt;
        :addClass(&#039;error&#039;)&lt;br /&gt;
        :cssText(args.style)&lt;br /&gt;
        :wikitext(tostring(args.message or args[1] or error(&#039;no message specified&#039;, 2)))&lt;br /&gt;
    )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.error(frame)&lt;br /&gt;
    local args&lt;br /&gt;
    if type(frame.args) == &#039;table&#039; then&lt;br /&gt;
        -- We&#039;re being called via #invoke. The args are passed through to the module&lt;br /&gt;
        -- from the template page, so use the args that were passed into the template.&lt;br /&gt;
        args = frame.args&lt;br /&gt;
    else&lt;br /&gt;
        -- We&#039;re being called from another module or from the debug console, so assume&lt;br /&gt;
        -- the args are passed in directly.&lt;br /&gt;
        args = frame&lt;br /&gt;
    end&lt;br /&gt;
    -- if the message parameter is present but blank, change it to nil so that Lua will&lt;br /&gt;
    -- consider it false.&lt;br /&gt;
    if args.message == &amp;quot;&amp;quot; then&lt;br /&gt;
        args.message = nil&lt;br /&gt;
    end&lt;br /&gt;
    return p._error(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Yesno&amp;diff=438</id>
		<title>模块:Yesno</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Yesno&amp;diff=438"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- Function allowing for consistent treatment of boolean-like wikitext input.&lt;br /&gt;
-- It works similarly to the template {{yesno}}.&lt;br /&gt;
&lt;br /&gt;
return function (val, default)&lt;br /&gt;
	-- If your wiki uses non-ascii characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you&lt;br /&gt;
	-- should replace &amp;quot;val:lower()&amp;quot; with &amp;quot;mw.ustring.lower(val)&amp;quot; in the&lt;br /&gt;
	-- following line.&lt;br /&gt;
	val = type(val) == &#039;string&#039; and val:lower() or val&lt;br /&gt;
	if val == nil then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif val == true &lt;br /&gt;
		or val == &#039;yes&#039;&lt;br /&gt;
		or val == &#039;y&#039;&lt;br /&gt;
		or val == &#039;true&#039;&lt;br /&gt;
		or val == &#039;t&#039;&lt;br /&gt;
		or val == &#039;on&#039;&lt;br /&gt;
		or val == &#039;是&#039;&lt;br /&gt;
		or val == &#039;开&#039;&lt;br /&gt;
		or val == &#039;開&#039;&lt;br /&gt;
		or tonumber(val) == 1&lt;br /&gt;
	then&lt;br /&gt;
		return true&lt;br /&gt;
	elseif val == false&lt;br /&gt;
		or val == &#039;no&#039;&lt;br /&gt;
		or val == &#039;n&#039;&lt;br /&gt;
		or val == &#039;false&#039;&lt;br /&gt;
		or val == &#039;f&#039;&lt;br /&gt;
		or val == &#039;off&#039;&lt;br /&gt;
		or val == &#039;否&#039;&lt;br /&gt;
		or val == &#039;关&#039;&lt;br /&gt;
		or val == &#039;關&#039;&lt;br /&gt;
		or tonumber(val) == 0&lt;br /&gt;
	then&lt;br /&gt;
		return false&lt;br /&gt;
	else&lt;br /&gt;
		return default&lt;br /&gt;
	end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Arguments&amp;diff=436</id>
		<title>模块:Arguments</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Arguments&amp;diff=436"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides easy processing of arguments passed to Scribunto from&lt;br /&gt;
-- #invoke. It is intended for use by other Lua modules, and should not be&lt;br /&gt;
-- called from #invoke directly.&lt;br /&gt;
&lt;br /&gt;
local libraryUtil = require(&#039;libraryUtil&#039;)&lt;br /&gt;
local checkType = libraryUtil.checkType&lt;br /&gt;
&lt;br /&gt;
local arguments = {}&lt;br /&gt;
&lt;br /&gt;
-- Generate four different tidyVal functions, so that we don&#039;t have to check the&lt;br /&gt;
-- options every time we call it.&lt;br /&gt;
&lt;br /&gt;
local function tidyValDefault(key, val)&lt;br /&gt;
	if type(val) == &#039;string&#039; then&lt;br /&gt;
		val = val:match(&#039;^%s*(.-)%s*$&#039;)&lt;br /&gt;
		if val == &#039;&#039; then&lt;br /&gt;
			return nil&lt;br /&gt;
		else&lt;br /&gt;
			return val&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tidyValTrimOnly(key, val)&lt;br /&gt;
	if type(val) == &#039;string&#039; then&lt;br /&gt;
		return val:match(&#039;^%s*(.-)%s*$&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		return val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tidyValRemoveBlanksOnly(key, val)&lt;br /&gt;
	if type(val) == &#039;string&#039; then&lt;br /&gt;
		if val:find(&#039;%S&#039;) then&lt;br /&gt;
			return val&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tidyValNoChange(key, val)&lt;br /&gt;
	return val&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function matchesTitle(given, title)&lt;br /&gt;
	local tp = type( given )&lt;br /&gt;
	return (tp == &#039;string&#039; or tp == &#039;number&#039;) and mw.title.new( given ).prefixedText == title&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local translate_mt = { __index = function(t, k) return k end }&lt;br /&gt;
&lt;br /&gt;
function arguments.getArgs(frame, options)&lt;br /&gt;
	checkType(&#039;getArgs&#039;, 1, frame, &#039;table&#039;, true)&lt;br /&gt;
	checkType(&#039;getArgs&#039;, 2, options, &#039;table&#039;, true)&lt;br /&gt;
	frame = frame or {}&lt;br /&gt;
	options = options or {}&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Set up argument translation.&lt;br /&gt;
	--]]&lt;br /&gt;
	options.translate = options.translate or {}&lt;br /&gt;
	if getmetatable(options.translate) == nil then&lt;br /&gt;
		setmetatable(options.translate, translate_mt)&lt;br /&gt;
	end&lt;br /&gt;
	if options.backtranslate == nil then&lt;br /&gt;
		options.backtranslate = {}&lt;br /&gt;
		for k,v in pairs(options.translate) do&lt;br /&gt;
			options.backtranslate[v] = k&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if options.backtranslate and getmetatable(options.backtranslate) == nil then&lt;br /&gt;
		setmetatable(options.backtranslate, {&lt;br /&gt;
			__index = function(t, k)&lt;br /&gt;
				if options.translate[k] ~= k then&lt;br /&gt;
					return nil&lt;br /&gt;
				else&lt;br /&gt;
					return k&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Get the argument tables. If we were passed a valid frame object, get the&lt;br /&gt;
	-- frame arguments (fargs) and the parent frame arguments (pargs), depending&lt;br /&gt;
	-- on the options set and on the parent frame&#039;s availability. If we weren&#039;t&lt;br /&gt;
	-- passed a valid frame object, we are being called from another Lua module&lt;br /&gt;
	-- or from the debug console, so assume that we were passed a table of args&lt;br /&gt;
	-- directly, and assign it to a new variable (luaArgs).&lt;br /&gt;
	--]]&lt;br /&gt;
	local fargs, pargs, luaArgs&lt;br /&gt;
	if type(frame.args) == &#039;table&#039; and type(frame.getParent) == &#039;function&#039; then&lt;br /&gt;
		if options.wrappers then&lt;br /&gt;
			--[[&lt;br /&gt;
			-- The wrappers option makes Module:Arguments look up arguments in&lt;br /&gt;
			-- either the frame argument table or the parent argument table, but&lt;br /&gt;
			-- not both. This means that users can use either the #invoke syntax&lt;br /&gt;
			-- or a wrapper template without the loss of performance associated&lt;br /&gt;
			-- with looking arguments up in both the frame and the parent frame.&lt;br /&gt;
			-- Module:Arguments will look up arguments in the parent frame&lt;br /&gt;
			-- if it finds the parent frame&#039;s title in options.wrapper;&lt;br /&gt;
			-- otherwise it will look up arguments in the frame object passed&lt;br /&gt;
			-- to getArgs.&lt;br /&gt;
			--]]&lt;br /&gt;
			local parent = frame:getParent()&lt;br /&gt;
			if not parent then&lt;br /&gt;
				fargs = frame.args&lt;br /&gt;
			else&lt;br /&gt;
				local title = parent:getTitle():gsub(&#039;/sandbox$&#039;, &#039;&#039;)&lt;br /&gt;
				local found = false&lt;br /&gt;
				if matchesTitle(options.wrappers, title) then&lt;br /&gt;
					found = true&lt;br /&gt;
				elseif type(options.wrappers) == &#039;table&#039; then&lt;br /&gt;
					for _,v in pairs(options.wrappers) do&lt;br /&gt;
						if matchesTitle(v, title) then&lt;br /&gt;
							found = true&lt;br /&gt;
							break&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				-- We test for false specifically here so that nil (the default) acts like true.&lt;br /&gt;
				if found or options.frameOnly == false then&lt;br /&gt;
					pargs = parent.args&lt;br /&gt;
				end&lt;br /&gt;
				if not found or options.parentOnly == false then&lt;br /&gt;
					fargs = frame.args&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- options.wrapper isn&#039;t set, so check the other options.&lt;br /&gt;
			if not options.parentOnly then&lt;br /&gt;
				fargs = frame.args&lt;br /&gt;
			end&lt;br /&gt;
			if not options.frameOnly then&lt;br /&gt;
				local parent = frame:getParent()&lt;br /&gt;
				pargs = parent and parent.args or nil&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if options.parentFirst then&lt;br /&gt;
			fargs, pargs = pargs, fargs&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		luaArgs = frame&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the order of precedence of the argument tables. If the variables are&lt;br /&gt;
	-- nil, nothing will be added to the table, which is how we avoid clashes&lt;br /&gt;
	-- between the frame/parent args and the Lua args.&lt;br /&gt;
	local argTables = {fargs}&lt;br /&gt;
	argTables[#argTables + 1] = pargs&lt;br /&gt;
	argTables[#argTables + 1] = luaArgs&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generate the tidyVal function. If it has been specified by the user, we&lt;br /&gt;
	-- use that; if not, we choose one of four functions depending on the&lt;br /&gt;
	-- options chosen. This is so that we don&#039;t have to call the options table&lt;br /&gt;
	-- every time the function is called.&lt;br /&gt;
	--]]&lt;br /&gt;
	local tidyVal = options.valueFunc&lt;br /&gt;
	if tidyVal then&lt;br /&gt;
		if type(tidyVal) ~= &#039;function&#039; then&lt;br /&gt;
			error(&lt;br /&gt;
				&amp;quot;bad value assigned to option &#039;valueFunc&#039;&amp;quot;&lt;br /&gt;
					.. &#039;(function expected, got &#039;&lt;br /&gt;
					.. type(tidyVal)&lt;br /&gt;
					.. &#039;)&#039;,&lt;br /&gt;
				2&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	elseif options.trim ~= false then&lt;br /&gt;
		if options.removeBlanks ~= false then&lt;br /&gt;
			tidyVal = tidyValDefault&lt;br /&gt;
		else&lt;br /&gt;
			tidyVal = tidyValTrimOnly&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if options.removeBlanks ~= false then&lt;br /&gt;
			tidyVal = tidyValRemoveBlanksOnly&lt;br /&gt;
		else&lt;br /&gt;
			tidyVal = tidyValNoChange&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Set up the args, metaArgs and nilArgs tables. args will be the one&lt;br /&gt;
	-- accessed from functions, and metaArgs will hold the actual arguments. Nil&lt;br /&gt;
	-- arguments are memoized in nilArgs, and the metatable connects all of them&lt;br /&gt;
	-- together.&lt;br /&gt;
	--]]&lt;br /&gt;
	local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}&lt;br /&gt;
	setmetatable(args, metatable)&lt;br /&gt;
&lt;br /&gt;
	local function mergeArgs(tables)&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Accepts multiple tables as input and merges their keys and values&lt;br /&gt;
		-- into one table. If a value is already present it is not overwritten;&lt;br /&gt;
		-- tables listed earlier have precedence. We are also memoizing nil&lt;br /&gt;
		-- values, which can be overwritten if they are &#039;s&#039; (soft).&lt;br /&gt;
		--]]&lt;br /&gt;
		for _, t in ipairs(tables) do&lt;br /&gt;
			for key, val in pairs(t) do&lt;br /&gt;
				if metaArgs[key] == nil and nilArgs[key] ~= &#039;h&#039; then&lt;br /&gt;
					local tidiedVal = tidyVal(key, val)&lt;br /&gt;
					if tidiedVal == nil then&lt;br /&gt;
						nilArgs[key] = &#039;s&#039;&lt;br /&gt;
					else&lt;br /&gt;
						metaArgs[key] = tidiedVal&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Define metatable behaviour. Arguments are memoized in the metaArgs table,&lt;br /&gt;
	-- and are only fetched from the argument tables once. Fetching arguments&lt;br /&gt;
	-- from the argument tables is the most resource-intensive step in this&lt;br /&gt;
	-- module, so we try and avoid it where possible. For this reason, nil&lt;br /&gt;
	-- arguments are also memoized, in the nilArgs table. Also, we keep a record&lt;br /&gt;
	-- in the metatable of when pairs and ipairs have been called, so we do not&lt;br /&gt;
	-- run pairs and ipairs on the argument tables more than once. We also do&lt;br /&gt;
	-- not run ipairs on fargs and pargs if pairs has already been run, as all&lt;br /&gt;
	-- the arguments will already have been copied over.&lt;br /&gt;
	--]]&lt;br /&gt;
&lt;br /&gt;
	metatable.__index = function (t, key)&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Fetches an argument when the args table is indexed. First we check&lt;br /&gt;
		-- to see if the value is memoized, and if not we try and fetch it from&lt;br /&gt;
		-- the argument tables. When we check memoization, we need to check&lt;br /&gt;
		-- metaArgs before nilArgs, as both can be non-nil at the same time.&lt;br /&gt;
		-- If the argument is not present in metaArgs, we also check whether&lt;br /&gt;
		-- pairs has been run yet. If pairs has already been run, we return nil.&lt;br /&gt;
		-- This is because all the arguments will have already been copied into&lt;br /&gt;
		-- metaArgs by the mergeArgs function, meaning that any other arguments&lt;br /&gt;
		-- must be nil.&lt;br /&gt;
		--]]&lt;br /&gt;
		if type(key) == &#039;string&#039; then&lt;br /&gt;
			key = options.translate[key]&lt;br /&gt;
		end&lt;br /&gt;
		local val = metaArgs[key]&lt;br /&gt;
		if val ~= nil then&lt;br /&gt;
			return val&lt;br /&gt;
		elseif metatable.donePairs or nilArgs[key] then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		for _, argTable in ipairs(argTables) do&lt;br /&gt;
			local argTableVal = tidyVal(key, argTable[key])&lt;br /&gt;
			if argTableVal ~= nil then&lt;br /&gt;
				metaArgs[key] = argTableVal&lt;br /&gt;
				return argTableVal&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		nilArgs[key] = &#039;h&#039;&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	metatable.__newindex = function (t, key, val)&lt;br /&gt;
		-- This function is called when a module tries to add a new value to the&lt;br /&gt;
		-- args table, or tries to change an existing value.&lt;br /&gt;
		if type(key) == &#039;string&#039; then&lt;br /&gt;
			key = options.translate[key]&lt;br /&gt;
		end&lt;br /&gt;
		if options.readOnly then&lt;br /&gt;
			error(&lt;br /&gt;
				&#039;could not write to argument table key &amp;quot;&#039;&lt;br /&gt;
					.. tostring(key)&lt;br /&gt;
					.. &#039;&amp;quot;; the table is read-only&#039;,&lt;br /&gt;
				2&lt;br /&gt;
			)&lt;br /&gt;
		elseif options.noOverwrite and args[key] ~= nil then&lt;br /&gt;
			error(&lt;br /&gt;
				&#039;could not write to argument table key &amp;quot;&#039;&lt;br /&gt;
					.. tostring(key)&lt;br /&gt;
					.. &#039;&amp;quot;; overwriting existing arguments is not permitted&#039;,&lt;br /&gt;
				2&lt;br /&gt;
			)&lt;br /&gt;
		elseif val == nil then&lt;br /&gt;
			--[[&lt;br /&gt;
			-- If the argument is to be overwritten with nil, we need to erase&lt;br /&gt;
			-- the value in metaArgs, so that __index, __pairs and __ipairs do&lt;br /&gt;
			-- not use a previous existing value, if present; and we also need&lt;br /&gt;
			-- to memoize the nil in nilArgs, so that the value isn&#039;t looked&lt;br /&gt;
			-- up in the argument tables if it is accessed again.&lt;br /&gt;
			--]]&lt;br /&gt;
			metaArgs[key] = nil&lt;br /&gt;
			nilArgs[key] = &#039;h&#039;&lt;br /&gt;
		else&lt;br /&gt;
			metaArgs[key] = val&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function translatenext(invariant)&lt;br /&gt;
		local k, v = next(invariant.t, invariant.k)&lt;br /&gt;
		invariant.k = k&lt;br /&gt;
		if k == nil then&lt;br /&gt;
			return nil&lt;br /&gt;
		elseif type(k) ~= &#039;string&#039; or not options.backtranslate then&lt;br /&gt;
			return k, v&lt;br /&gt;
		else&lt;br /&gt;
			local backtranslate = options.backtranslate[k]&lt;br /&gt;
			if backtranslate == nil then&lt;br /&gt;
				-- Skip this one. This is a tail call, so this won&#039;t cause stack overflow&lt;br /&gt;
				return translatenext(invariant)&lt;br /&gt;
			else&lt;br /&gt;
				return backtranslate, v&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	metatable.__pairs = function ()&lt;br /&gt;
		-- Called when pairs is run on the args table.&lt;br /&gt;
		if not metatable.donePairs then&lt;br /&gt;
			mergeArgs(argTables)&lt;br /&gt;
			metatable.donePairs = true&lt;br /&gt;
		end&lt;br /&gt;
		return translatenext, { t = metaArgs }&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function inext(t, i)&lt;br /&gt;
		-- This uses our __index metamethod&lt;br /&gt;
		local v = t[i + 1]&lt;br /&gt;
		if v ~= nil then&lt;br /&gt;
			return i + 1, v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	metatable.__ipairs = function (t)&lt;br /&gt;
		-- Called when ipairs is run on the args table.&lt;br /&gt;
		return inext, t, 0&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return arguments&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1/Whitelist&amp;diff=434</id>
		<title>模块:Citation/CS1/Whitelist</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1/Whitelist&amp;diff=434"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
--[[--------------------------&amp;lt; P A R A M E T E R S   N O T   S U P P O R T E D &amp;gt;------------------------------&lt;br /&gt;
&lt;br /&gt;
This is a list of parameters that once were but now are no longer supported:&lt;br /&gt;
&lt;br /&gt;
	[&#039;albumlink&#039;] = nil,			-- unique alias of titlelink used by old cite AV media notes&lt;br /&gt;
	[&#039;albumtype&#039;] = nil,			-- controled inappropriate functionality in the old cite AV media notes&lt;br /&gt;
	[&#039;artist&#039;] = nil,				-- unique alias of others used by old cite AV media notes&lt;br /&gt;
	[&#039;Author&#039;] = nil,				-- non-standard capitalization&lt;br /&gt;
	[&#039;authorformat&#039;] = nil,			-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;author-format&#039;] = nil,		-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;author-name-separator&#039;] = nil,-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;author-separator&#039;] = nil,		-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;began&#039;] = nil,				-- module handles date ranges; cite episode and cite series&lt;br /&gt;
	[&#039;chapterlink&#039;] = nil,			-- if ever necessary to link to a chapter article, |chapter= can be wikilinked &lt;br /&gt;
	[&#039;chapter-link&#039;] = nil,			-- &lt;br /&gt;
	[&#039;cointerviewers&#039;] = nil,		-- unique alias of others used by old cite interview&lt;br /&gt;
	[&#039;day&#039;] = nil,					-- deprecated in {{citation/core}} and somehow undeprecated in Module:Citation/CS1 and now finally removed&lt;br /&gt;
	[&#039;director&#039;] = nil,				-- unique alias of author used by old cite DVD-notes&lt;br /&gt;
	[&#039;DoiBroken&#039;] = nil,			-- not used, non-standard captialization&lt;br /&gt;
	[&#039;Editor&#039;] = nil,				-- non-standard capitalization&lt;br /&gt;
	[&#039;editorformat&#039;] = nil,			-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;EditorSurname&#039;] = nil,		-- non-standard capitalization&lt;br /&gt;
	[&#039;editor-format&#039;] = nil,		-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;EditorGiven&#039;] = nil,			-- non-standard capitalization&lt;br /&gt;
	[&#039;editor-name-separator&#039;] = nil,-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;editor-separator&#039;] = nil,		-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;Embargo&#039;] = nil,				-- not used, non-standard capitalization&lt;br /&gt;
	[&#039;ended&#039;] = nil,				-- module handles date ranges; cite episode and cite series&lt;br /&gt;
	[&#039;month&#039;] = nil,				-- functionality supported by |date=&lt;br /&gt;
	[&#039;name-separator&#039;] = nil,		-- primarily used to support Vancouver format which functionality now part of name-list-format&lt;br /&gt;
	[&#039;notestitle&#039;] = nil,			-- unique alias of chapter used by old cite AV media notes&lt;br /&gt;
	[&#039;PPrefix&#039;] = nil,				-- non-standard capitalization&lt;br /&gt;
	[&#039;PPPrefix&#039;] = nil,				-- not used, non-standard capitalization&lt;br /&gt;
	[&#039;pp-prefix&#039;] = nil,			-- not used, not documented&lt;br /&gt;
	[&#039;p-prefix&#039;] = nil,				-- not used, not documented&lt;br /&gt;
	[&#039;publisherid&#039;] = nil,			-- unique alias of id used by old cite AV media notes and old cite DVD-notes&lt;br /&gt;
	[&#039;Ref&#039;] = nil,					-- non-statndard capitalization&lt;br /&gt;
	[&#039;separator&#039;] = nil,			-- this functionality now provided by |mode=&lt;br /&gt;
	[&#039;titleyear&#039;] = nil,			-- unique alias of origyear used by old cite DVD-notes&lt;br /&gt;
&lt;br /&gt;
	[&#039;Author#&#039;] = nil,				-- non-standard capitalization&lt;br /&gt;
	[&#039;authors#&#039;] = nil,				-- no need for multiple lists of author names&lt;br /&gt;
	[&#039;Editor#&#039;] = nil,				-- non-standard capitalization&lt;br /&gt;
	[&#039;editors#&#039;] = nil,				-- no need for multiple lists of editor names&lt;br /&gt;
	[&#039;EditorGiven#&#039;] = nil,			-- non-standard capitalization&lt;br /&gt;
	[&#039;EditorSurname#&#039;] = nil,		-- non-standard capitalization&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S U P P O R T E D   P A R A M E T E R S &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items can have three values:&lt;br /&gt;
	true - these parameters are valid and supported parameters&lt;br /&gt;
	false - these parameters are deprecated but still supported&lt;br /&gt;
	nil - these parameters are no longer supported (when setting a parameter to nil, leave a comment stating the reasons for invalidating the parameter)&lt;br /&gt;
	&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local whitelist = {}&lt;br /&gt;
&lt;br /&gt;
local basic_arguments = {&lt;br /&gt;
	[&#039;accessdate&#039;] = true,&lt;br /&gt;
	[&#039;access-date&#039;] = true,&lt;br /&gt;
	[&#039;agency&#039;] = true,&lt;br /&gt;
	[&#039;airdate&#039;] = true,&lt;br /&gt;
	[&#039;air-date&#039;] = true,&lt;br /&gt;
	[&#039;archivedate&#039;] = true,&lt;br /&gt;
	[&#039;archive-date&#039;] = true,&lt;br /&gt;
	[&#039;archive-format&#039;] = true,&lt;br /&gt;
	[&#039;archiveurl&#039;] = true,&lt;br /&gt;
	[&#039;archive-url&#039;] = true,&lt;br /&gt;
	[&#039;article&#039;] = true,&lt;br /&gt;
	[&#039;arxiv&#039;] = true,&lt;br /&gt;
	[&#039;ARXIV&#039;] = true,&lt;br /&gt;
	[&#039;asin&#039;] = true,&lt;br /&gt;
	[&#039;ASIN&#039;] = true,&lt;br /&gt;
	[&#039;asin-tld&#039;] = true,&lt;br /&gt;
	[&#039;ASIN-TLD&#039;] = true,&lt;br /&gt;
	[&#039;at&#039;] = true,&lt;br /&gt;
	[&#039;author&#039;] = true,&lt;br /&gt;
	[&#039;author-first&#039;] = true,&lt;br /&gt;
	[&#039;author-last&#039;] = true,&lt;br /&gt;
	[&#039;authorlink&#039;] = true,&lt;br /&gt;
	[&#039;author-link&#039;] = true,&lt;br /&gt;
	[&#039;authormask&#039;] = true,&lt;br /&gt;
	[&#039;author-mask&#039;] = true,&lt;br /&gt;
	[&#039;authors&#039;] = true,&lt;br /&gt;
	[&#039;bibcode&#039;] = true,&lt;br /&gt;
	[&#039;BIBCODE&#039;] = true,&lt;br /&gt;
	[&#039;bibcode-access&#039;] = true,&lt;br /&gt;
	[&#039;biorxiv&#039;] = true,&lt;br /&gt;
	[&#039;booktitle&#039;] = true,&lt;br /&gt;
	[&#039;book-title&#039;] = true,&lt;br /&gt;
	[&#039;callsign&#039;] = true,			-- cite interview&lt;br /&gt;
	[&#039;call-sign&#039;] = true,			-- cite interview&lt;br /&gt;
	[&#039;cartography&#039;] = true,&lt;br /&gt;
	[&#039;chapter&#039;] = true,&lt;br /&gt;
	[&#039;chapter-format&#039;] = true,&lt;br /&gt;
	[&#039;chapterurl&#039;] = true,&lt;br /&gt;
	[&#039;chapter-url&#039;] = true,&lt;br /&gt;
	[&#039;chapter-url-access&#039;] = true,&lt;br /&gt;
	[&#039;citeseerx&#039;] = true,&lt;br /&gt;
	[&#039;city&#039;] = true,				-- cite interview, cite episode, cite serial&lt;br /&gt;
	[&#039;class&#039;] = true,				-- cite arxiv and arxiv identifiers&lt;br /&gt;
	[&#039;cn&#039;] = true,&lt;br /&gt;
	[&#039;CN&#039;] = true,&lt;br /&gt;
	[&#039;coauthor&#039;] = false,			-- deprecated&lt;br /&gt;
	[&#039;coauthors&#039;] = false,			-- deprecated&lt;br /&gt;
	[&#039;conference&#039;] = true,&lt;br /&gt;
	[&#039;conference-format&#039;] = true,&lt;br /&gt;
	[&#039;conferenceurl&#039;] = true,&lt;br /&gt;
	[&#039;conference-url&#039;] = true,&lt;br /&gt;
	[&#039;contribution&#039;] = true,&lt;br /&gt;
	[&#039;contribution-format&#039;] = true,&lt;br /&gt;
	[&#039;contributionurl&#039;] = true,&lt;br /&gt;
	[&#039;contribution-url&#039;] = true,&lt;br /&gt;
	[&#039;contributor&#039;] = true,&lt;br /&gt;
	[&#039;contributor-first&#039;] = true,&lt;br /&gt;
	[&#039;contributor-last&#039;] = true,&lt;br /&gt;
	[&#039;contributor-link&#039;] = true,&lt;br /&gt;
	[&#039;contributor-mask&#039;] = true,&lt;br /&gt;
	[&#039;credits&#039;] = true,				-- cite episode, cite serial&lt;br /&gt;
	[&#039;date&#039;] = true,&lt;br /&gt;
	[&#039;deadurl&#039;] = true,&lt;br /&gt;
	[&#039;dead-url&#039;] = true,&lt;br /&gt;
	[&#039;degree&#039;] = true,&lt;br /&gt;
	[&#039;department&#039;] = true,&lt;br /&gt;
	[&#039;dictionary&#039;] = true,&lt;br /&gt;
	[&#039;displayauthors&#039;] = true,&lt;br /&gt;
	[&#039;display-authors&#039;] = true,&lt;br /&gt;
	[&#039;displayeditors&#039;] = true,&lt;br /&gt;
	[&#039;display-editors&#039;] = true,&lt;br /&gt;
	[&#039;docket&#039;] = true,&lt;br /&gt;
	[&#039;doi&#039;] = true,&lt;br /&gt;
	[&#039;DOI&#039;] = true,&lt;br /&gt;
	[&#039;doi-access&#039;] = true,&lt;br /&gt;
	[&#039;doi-broken&#039;] = true,&lt;br /&gt;
	[&#039;doi_brokendate&#039;] = true,&lt;br /&gt;
	[&#039;doi-broken-date&#039;] = true,&lt;br /&gt;
	[&#039;doi_inactivedate&#039;] = true,&lt;br /&gt;
	[&#039;doi-inactive-date&#039;] = true,&lt;br /&gt;
	[&#039;edition&#039;] = true,&lt;br /&gt;
	[&#039;editor&#039;] = true,&lt;br /&gt;
	[&#039;editor-first&#039;] = true,&lt;br /&gt;
	[&#039;editor-given&#039;] = true,&lt;br /&gt;
	[&#039;editor-last&#039;] = true,&lt;br /&gt;
	[&#039;editorlink&#039;] = true,&lt;br /&gt;
	[&#039;editor-link&#039;] = true,&lt;br /&gt;
	[&#039;editormask&#039;] = true,&lt;br /&gt;
	[&#039;editor-mask&#039;] = true,&lt;br /&gt;
	[&#039;editors&#039;] = true,&lt;br /&gt;
	[&#039;editor-surname&#039;] = true,&lt;br /&gt;
	[&#039;eissn&#039;] = true,&lt;br /&gt;
	[&#039;EISSN&#039;] = true,&lt;br /&gt;
	[&#039;embargo&#039;] = true,&lt;br /&gt;
	[&#039;encyclopaedia&#039;] = true,&lt;br /&gt;
	[&#039;encyclopedia&#039;] = true,&lt;br /&gt;
	[&#039;entry&#039;] = true,&lt;br /&gt;
	[&#039;episode&#039;] = true,															-- cite serial only TODO: make available to cite episode?&lt;br /&gt;
	[&#039;episodelink&#039;] = true,														-- cite episode and cite serial&lt;br /&gt;
	[&#039;episode-link&#039;] = true,													-- cite episode and cite serial&lt;br /&gt;
	[&#039;eprint&#039;] = true,															-- cite arxiv and arxiv identifiers&lt;br /&gt;
	[&#039;event&#039;] = true,&lt;br /&gt;
	[&#039;event-format&#039;] = true,&lt;br /&gt;
	[&#039;eventurl&#039;] = true,&lt;br /&gt;
	[&#039;event-url&#039;] = true,&lt;br /&gt;
	[&#039;first&#039;] = true,&lt;br /&gt;
	[&#039;format&#039;] = true,&lt;br /&gt;
	[&#039;given&#039;] = true,&lt;br /&gt;
	[&#039;hdl&#039;] = true,&lt;br /&gt;
	[&#039;HDL&#039;] = true,&lt;br /&gt;
	[&#039;hdl-access&#039;] = true,&lt;br /&gt;
	[&#039;host&#039;] = true,&lt;br /&gt;
	[&#039;id&#039;] = true,&lt;br /&gt;
	[&#039;ID&#039;] = true,&lt;br /&gt;
	[&#039;ignoreisbnerror&#039;] = true,&lt;br /&gt;
	[&#039;ignore-isbn-error&#039;] = true,&lt;br /&gt;
	[&#039;in&#039;] = true,&lt;br /&gt;
	[&#039;inset&#039;] = true,&lt;br /&gt;
	[&#039;institution&#039;] = true,&lt;br /&gt;
	[&#039;interviewer&#039;] = true,				--cite interview&lt;br /&gt;
	[&#039;interviewers&#039;] = true,			--cite interview&lt;br /&gt;
	[&#039;isbn&#039;] = true,&lt;br /&gt;
	[&#039;ISBN&#039;] = true,&lt;br /&gt;
	[&#039;isbn13&#039;] = true,&lt;br /&gt;
	[&#039;ISBN13&#039;] = true,&lt;br /&gt;
	[&#039;ismn&#039;] = true,&lt;br /&gt;
	[&#039;ISMN&#039;] = true,&lt;br /&gt;
	[&#039;issn&#039;] = true,&lt;br /&gt;
	[&#039;ISSN&#039;] = true,&lt;br /&gt;
	[&#039;issue&#039;] = true,&lt;br /&gt;
	[&#039;jfm&#039;] = true,&lt;br /&gt;
	[&#039;JFM&#039;] = true,&lt;br /&gt;
	[&#039;journal&#039;] = true,&lt;br /&gt;
	[&#039;jstor&#039;] = true,&lt;br /&gt;
	[&#039;JSTOR&#039;] = true,&lt;br /&gt;
	[&#039;jstor-access&#039;] = true,&lt;br /&gt;
	[&#039;language&#039;] = true,&lt;br /&gt;
	[&#039;last&#039;] = true,&lt;br /&gt;
	[&#039;lastauthoramp&#039;] = true,&lt;br /&gt;
	[&#039;last-author-amp&#039;] = true,&lt;br /&gt;
	[&#039;laydate&#039;] = true,&lt;br /&gt;
	[&#039;lay-date&#039;] = true,&lt;br /&gt;
	[&#039;laysource&#039;] = true,&lt;br /&gt;
	[&#039;lay-source&#039;] = true,&lt;br /&gt;
	[&#039;laysummary&#039;] = true,&lt;br /&gt;
	[&#039;lay-summary&#039;] = true,&lt;br /&gt;
	[&#039;lay-format&#039;] = true,&lt;br /&gt;
	[&#039;layurl&#039;] = true,&lt;br /&gt;
	[&#039;lay-url&#039;] = true,&lt;br /&gt;
	[&#039;lccn&#039;] = true,&lt;br /&gt;
	[&#039;LCCN&#039;] = true,&lt;br /&gt;
	[&#039;location&#039;] = true,&lt;br /&gt;
	[&#039;magazine&#039;] = true,&lt;br /&gt;
	[&#039;mailinglist&#039;] = true,				-- cite mailing list only&lt;br /&gt;
	[&#039;mailing-list&#039;] = true,			-- cite mailing list only&lt;br /&gt;
	[&#039;map&#039;] = true,						-- cite map only&lt;br /&gt;
	[&#039;map-format&#039;] = true,				-- cite map only&lt;br /&gt;
	[&#039;mapurl&#039;] = true,					-- cite map only&lt;br /&gt;
	[&#039;map-url&#039;] = true,					-- cite map only&lt;br /&gt;
	[&#039;map-url-access&#039;] = true,			-- cite map only &lt;br /&gt;
	[&#039;medium&#039;] = true,&lt;br /&gt;
	[&#039;message-id&#039;] = true,			-- cite newsgroup&lt;br /&gt;
	[&#039;minutes&#039;] = true,&lt;br /&gt;
	[&#039;mode&#039;] = true,&lt;br /&gt;
	[&#039;mr&#039;] = true,&lt;br /&gt;
	[&#039;MR&#039;] = true,&lt;br /&gt;
	[&#039;name-list-format&#039;] = true,&lt;br /&gt;
	[&#039;name-list-style&#039;] = true,&lt;br /&gt;
	[&#039;network&#039;] = true,&lt;br /&gt;
	[&#039;newsgroup&#039;] = true,&lt;br /&gt;
	[&#039;newspaper&#039;] = true,&lt;br /&gt;
	[&#039;nocat&#039;] = true,&lt;br /&gt;
	[&#039;no-cat&#039;] = true,&lt;br /&gt;
	[&#039;nopp&#039;] = true,&lt;br /&gt;
	[&#039;no-pp&#039;] = true,&lt;br /&gt;
	[&#039;notracking&#039;] = true,&lt;br /&gt;
	[&#039;no-tracking&#039;] = true,&lt;br /&gt;
	[&#039;number&#039;] = true,&lt;br /&gt;
	[&#039;oclc&#039;] = true,&lt;br /&gt;
	[&#039;OCLC&#039;] = true,&lt;br /&gt;
	[&#039;ol&#039;] = true,&lt;br /&gt;
	[&#039;OL&#039;] = true,&lt;br /&gt;
	[&#039;ol-access&#039;] = true,&lt;br /&gt;
	[&#039;origyear&#039;] = true,&lt;br /&gt;
	[&#039;orig-year&#039;] = true,&lt;br /&gt;
	[&#039;osti&#039;] = true,&lt;br /&gt;
	[&#039;OSTI&#039;] = true,&lt;br /&gt;
	[&#039;osti-access&#039;] = true,&lt;br /&gt;
	[&#039;others&#039;] = true,&lt;br /&gt;
	[&#039;p&#039;] = true,&lt;br /&gt;
	[&#039;page&#039;] = true,&lt;br /&gt;
	[&#039;pages&#039;] = true,&lt;br /&gt;
	[&#039;people&#039;] = true,&lt;br /&gt;
	[&#039;periodical&#039;] = true,&lt;br /&gt;
	[&#039;place&#039;] = true,&lt;br /&gt;
	[&#039;pmc&#039;] = true,&lt;br /&gt;
	[&#039;PMC&#039;] = true,&lt;br /&gt;
	[&#039;pmid&#039;] = true,&lt;br /&gt;
	[&#039;PMID&#039;] = true,&lt;br /&gt;
	[&#039;postscript&#039;] = true,&lt;br /&gt;
	[&#039;pp&#039;] = true,&lt;br /&gt;
	[&#039;program&#039;] = true,				-- cite interview&lt;br /&gt;
	[&#039;publicationdate&#039;] = true,&lt;br /&gt;
	[&#039;publication-date&#039;] = true,&lt;br /&gt;
	[&#039;publicationplace&#039;] = true,&lt;br /&gt;
	[&#039;publication-place&#039;] = true,&lt;br /&gt;
	[&#039;publisher&#039;] = true,&lt;br /&gt;
	[&#039;quotation&#039;] = true,&lt;br /&gt;
	[&#039;quote&#039;] = true,&lt;br /&gt;
	[&#039;ref&#039;] = true,&lt;br /&gt;
	[&#039;registration&#039;] = true,&lt;br /&gt;
	[&#039;rfc&#039;] = true,&lt;br /&gt;
	[&#039;RFC&#039;] = true,&lt;br /&gt;
	[&#039;s2cid&#039;] = true,&lt;br /&gt;
	[&#039;s2cid-access&#039;] = true,&lt;br /&gt;
	[&#039;scale&#039;] = true,&lt;br /&gt;
	[&#039;script-chapter&#039;] = true,&lt;br /&gt;
	[&#039;script-title&#039;] = true,&lt;br /&gt;
	[&#039;season&#039;] = true,&lt;br /&gt;
	[&#039;section&#039;] = true,&lt;br /&gt;
	[&#039;section-format&#039;] = true,&lt;br /&gt;
	[&#039;sections&#039;] = true,					-- cite map only&lt;br /&gt;
	[&#039;sectionurl&#039;] = true,&lt;br /&gt;
	[&#039;section-url&#039;] = true,&lt;br /&gt;
	[&#039;section-url-access&#039;] = true,&lt;br /&gt;
	[&#039;series&#039;] = true,&lt;br /&gt;
	[&#039;serieslink&#039;] = true,&lt;br /&gt;
	[&#039;series-link&#039;] = true,&lt;br /&gt;
	[&#039;seriesno&#039;] = true,&lt;br /&gt;
	[&#039;series-no&#039;] = true,&lt;br /&gt;
	[&#039;seriesnumber&#039;] = true,&lt;br /&gt;
	[&#039;series-number&#039;] = true,&lt;br /&gt;
	[&#039;series-separator&#039;] = true,&lt;br /&gt;
	[&#039;sheet&#039;] = true,															-- cite map only&lt;br /&gt;
	[&#039;sheets&#039;] = true,															-- cite map only&lt;br /&gt;
	[&#039;ssrn&#039;] = true,&lt;br /&gt;
	[&#039;SSRN&#039;] = true,&lt;br /&gt;
	[&#039;station&#039;] = true,&lt;br /&gt;
	[&#039;subject&#039;] = true,&lt;br /&gt;
	[&#039;subjectlink&#039;] = true,&lt;br /&gt;
	[&#039;subject-link&#039;] = true,&lt;br /&gt;
	[&#039;subscription&#039;] = true,&lt;br /&gt;
	[&#039;surname&#039;] = true,&lt;br /&gt;
	[&#039;template doc demo&#039;] = true,&lt;br /&gt;
	[&#039;template-doc-demo&#039;] = true,&lt;br /&gt;
	[&#039;time&#039;] = true,&lt;br /&gt;
	[&#039;timecaption&#039;] = true,&lt;br /&gt;
	[&#039;time-caption&#039;] = true,&lt;br /&gt;
	[&#039;title&#039;] = true,&lt;br /&gt;
	[&#039;titlelink&#039;] = true,&lt;br /&gt;
	[&#039;title-link&#039;] = true,&lt;br /&gt;
	[&#039;title_zh&#039;] = true,&lt;br /&gt;
	[&#039;trans_chapter&#039;] = true,&lt;br /&gt;
	[&#039;trans-chapter&#039;] = true,&lt;br /&gt;
	[&#039;trans-map&#039;] = true,&lt;br /&gt;
	[&#039;transcript&#039;] = true,&lt;br /&gt;
	[&#039;transcript-format&#039;] = true,&lt;br /&gt;
	[&#039;transcripturl&#039;] = true,&lt;br /&gt;
	[&#039;transcript-url&#039;] = true,&lt;br /&gt;
	[&#039;trans_title&#039;] = true,&lt;br /&gt;
	[&#039;trans-title&#039;] = true,&lt;br /&gt;
	[&#039;translator&#039;] = true,&lt;br /&gt;
	[&#039;translator-first&#039;] = true,&lt;br /&gt;
	[&#039;translator-last&#039;] = true,&lt;br /&gt;
	[&#039;translator-link&#039;] = true,&lt;br /&gt;
	[&#039;translator-mask&#039;] = true,&lt;br /&gt;
	[&#039;type&#039;] = true,&lt;br /&gt;
	[&#039;url&#039;] = true,&lt;br /&gt;
	[&#039;URL&#039;] = true,&lt;br /&gt;
	[&#039;urlaccess&#039;] = true,&lt;br /&gt;
	[&#039;url-access&#039;] = true,&lt;br /&gt;
	[&#039;urlstatus&#039;] = true,&lt;br /&gt;
	[&#039;url-status&#039;] = true,&lt;br /&gt;
	[&#039;vauthors&#039;] = true,&lt;br /&gt;
	[&#039;veditors&#039;] = true,&lt;br /&gt;
	[&#039;version&#039;] = true,&lt;br /&gt;
	[&#039;via&#039;] = true,&lt;br /&gt;
	[&#039;volume&#039;] = true,&lt;br /&gt;
	[&#039;website&#039;] = true,&lt;br /&gt;
	[&#039;work&#039;] = true,&lt;br /&gt;
	[&#039;year&#039;] = true,&lt;br /&gt;
	[&#039;zbl&#039;] = true,&lt;br /&gt;
	[&#039;ZBL&#039;] = true,&lt;br /&gt;
	[&#039;unified&#039;] = true,&lt;br /&gt;
	[&#039;csbn&#039;] = true,&lt;br /&gt;
	[&#039;CSBN&#039;] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local numbered_arguments = {&lt;br /&gt;
	[&#039;author#&#039;] = true,&lt;br /&gt;
	[&#039;author-first#&#039;] = true,&lt;br /&gt;
	[&#039;author#-first&#039;] = true,&lt;br /&gt;
	[&#039;author-last#&#039;] = true,&lt;br /&gt;
	[&#039;author#-last&#039;] = true,&lt;br /&gt;
	[&#039;author-link#&#039;] = true,&lt;br /&gt;
	[&#039;author#link&#039;] = true,&lt;br /&gt;
	[&#039;author#-link&#039;] = true,&lt;br /&gt;
	[&#039;authorlink#&#039;] = true,&lt;br /&gt;
	[&#039;author-mask#&#039;] = true,&lt;br /&gt;
	[&#039;author#mask&#039;] = true,&lt;br /&gt;
	[&#039;author#-mask&#039;] = true,&lt;br /&gt;
	[&#039;authormask#&#039;] = true,&lt;br /&gt;
	[&#039;contributor#&#039;] = true,&lt;br /&gt;
	[&#039;contributor-first#&#039;] = true,&lt;br /&gt;
	[&#039;contributor#-first&#039;] = true,&lt;br /&gt;
	[&#039;contributor-last#&#039;] = true,&lt;br /&gt;
	[&#039;contributor#-last&#039;] = true,&lt;br /&gt;
	[&#039;contributor-link#&#039;] = true,&lt;br /&gt;
	[&#039;contributor#-link&#039;] = true,&lt;br /&gt;
	[&#039;contributor-mask#&#039;] = true,&lt;br /&gt;
	[&#039;contributor#-mask&#039;] = true,&lt;br /&gt;
	[&#039;editor#&#039;] = true,&lt;br /&gt;
	[&#039;editor-first#&#039;] = true,&lt;br /&gt;
	[&#039;editor#-first&#039;] = true,&lt;br /&gt;
	[&#039;editor#-given&#039;] = true,&lt;br /&gt;
	[&#039;editor-given#&#039;] = true,&lt;br /&gt;
	[&#039;editor-last#&#039;] = true,&lt;br /&gt;
	[&#039;editor#-last&#039;] = true,&lt;br /&gt;
	[&#039;editor-link#&#039;] = true,&lt;br /&gt;
	[&#039;editor#link&#039;] = true,&lt;br /&gt;
	[&#039;editor#-link&#039;] = true,&lt;br /&gt;
	[&#039;editorlink#&#039;] = true,&lt;br /&gt;
	[&#039;editor-mask#&#039;] = true,&lt;br /&gt;
	[&#039;editor#mask&#039;] = true,&lt;br /&gt;
	[&#039;editor#-mask&#039;] = true,&lt;br /&gt;
	[&#039;editormask#&#039;] = true,&lt;br /&gt;
	[&#039;editor#-surname&#039;] = true,&lt;br /&gt;
	[&#039;editor-surname#&#039;] = true,&lt;br /&gt;
	[&#039;first#&#039;] = true,&lt;br /&gt;
	[&#039;given#&#039;] = true,&lt;br /&gt;
	[&#039;last#&#039;] = true,&lt;br /&gt;
	[&#039;subject#&#039;] = true,&lt;br /&gt;
	[&#039;subject-link#&#039;] = true,&lt;br /&gt;
	[&#039;subject#link&#039;] = true,&lt;br /&gt;
	[&#039;subject#-link&#039;] = true,&lt;br /&gt;
	[&#039;subjectlink#&#039;] = true,&lt;br /&gt;
	[&#039;surname#&#039;] = true,&lt;br /&gt;
	[&#039;translator#&#039;] = true,&lt;br /&gt;
	[&#039;translator-first#&#039;] = true,&lt;br /&gt;
	[&#039;translator#-first&#039;] = true,&lt;br /&gt;
	[&#039;translator-last#&#039;] = true,&lt;br /&gt;
	[&#039;translator#-last&#039;] = true,&lt;br /&gt;
	[&#039;translator-link#&#039;] = true,&lt;br /&gt;
	[&#039;translator#-link&#039;] = true,&lt;br /&gt;
	[&#039;translator-mask#&#039;] = true,&lt;br /&gt;
	[&#039;translator#-mask&#039;] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return {basic_arguments = basic_arguments, numbered_arguments = numbered_arguments};&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1/Configuration&amp;diff=432</id>
		<title>模块:Citation/CS1/Configuration</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1/Configuration&amp;diff=432"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local lang_obj = mw.language.getContentLanguage();								-- make a language object for the local language; used here for languages and dates &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S E T T I N G S &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
boolean settings used to control various things.  these setting located here to make them easy to find&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
																				-- these settings local to this module only&lt;br /&gt;
local local_digits_from_mediawiki = false;										-- for i18n; when true, module fills date_names[&#039;local_digits&#039;] from MediaWiki; manual fill required else; always false at en.wiki&lt;br /&gt;
local local_date_names_from_mediawiki = false;									-- for i18n; when true, module fills date_names[&#039;local&#039;][&#039;long&#039;] and date_names[&#039;local&#039;][&#039;short&#039;] from MediaWiki;&lt;br /&gt;
																				-- manual translation required else; ; always false at en.wiki&lt;br /&gt;
&lt;br /&gt;
																				-- these settings exported to other modules&lt;br /&gt;
local use_identifier_redirects = true;											-- when true use redirect name for identifier label links; always true at en.wiki&lt;br /&gt;
local local_lang_cat_enable = false;											-- when true categorizes pages where |language=&amp;lt;local wiki&#039;s language&amp;gt;; always false at en.wiki&lt;br /&gt;
local date_name_auto_xlate_enable = false;										-- when true translates English month-names to the local-wiki&#039;s language month names; always false at en.wiki&lt;br /&gt;
local date_digit_auto_xlate_enable = false;										-- when true translates Western date digit to the local-wiki&#039;s language digits (date_names[&#039;local_digits&#039;]); always false at en.wiki&lt;br /&gt;
local enable_sort_keys = true;													-- when true module adds namespace sort keys to error and maintenance category links&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; U N C A T E G O R I Z E D _ N A M E S P A C E S &amp;gt;------------------------------&lt;br /&gt;
&lt;br /&gt;
List of namespaces identifiers for namespaces that will not be included in citation error categories.&lt;br /&gt;
Same as setting notracking = true by default.&lt;br /&gt;
&lt;br /&gt;
For wikis that have a current version of Module:cs1 documentation support, this #invoke will return an unordered&lt;br /&gt;
list of namespace names and their associated identifiers:&lt;br /&gt;
	{{#invoke:cs1 documentation support|uncategorized_namespace_lister|all=&amp;lt;anything&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local uncategorized_namespaces_t = {[2]=true};										-- init with user namespace id&lt;br /&gt;
for k, _ in pairs (mw.site.talkNamespaces) do									-- add all talk namespace ids&lt;br /&gt;
	uncategorized_namespaces_t[k] = true;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local uncategorized_subpages = {&#039;/[Ss]andbox&#039;, &#039;/[Tt]estcases&#039;, &#039;/[^/]*[Ll]og&#039;, &#039;/[Aa]rchive&#039;};		-- list of Lua patterns found in page names of pages we should not categorize&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
at en.wiki Greek characters are used as sort keys for certain items in a category so that those items are&lt;br /&gt;
placed at the end of a category page.  See Wikipedia:Categorization#Sort_keys.  That works well for en.wiki&lt;br /&gt;
because English is written using the Latn script.  This may not work well for other languages.  At en.wiki it&lt;br /&gt;
is desireable to place content from certain namespaces at the end of a category listing so the module adds sort&lt;br /&gt;
keys to error and maintenance category links when rendering a cs1|2 template on a page in that namespace.&lt;br /&gt;
&lt;br /&gt;
i18n: if this does not work well for your language, set &amp;lt;enable_sort_keys&amp;gt; to false.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local name_space_sort_keys = {													-- sort keys to be used with these namespaces:&lt;br /&gt;
	[4] = &#039;ω&#039;,																	-- wikipedia; omega&lt;br /&gt;
	[10] = &#039;τ&#039;,																	-- template; tau&lt;br /&gt;
	[118] = &#039;Δ&#039;, 																-- draft; delta&lt;br /&gt;
	[&#039;other&#039;] = &#039;ο&#039;,															-- all other non-talk namespaces except main (article); omicron&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M E S S A G E S &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Translation table&lt;br /&gt;
&lt;br /&gt;
The following contains fixed text that may be output as part of a citation.&lt;br /&gt;
This is separated from the main body to aid in future translations of this&lt;br /&gt;
module.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local messages = {&lt;br /&gt;
	[&#039;agency&#039;] = &#039;$1 $2&#039;,														-- $1 is sepc, $2 is agency&lt;br /&gt;
	[&#039;archived-dead&#039;] = &#039;Archived from $1 on $2&#039;,&lt;br /&gt;
	[&#039;archived-live&#039;] = &#039;$1 from the original on $2&#039;,&lt;br /&gt;
	[&#039;archived-unfit&#039;] = &#039;Archived from the original on &#039;,&lt;br /&gt;
	[&#039;archived&#039;] = &#039;Archived&#039;,&lt;br /&gt;
	[&#039;by&#039;] = &#039;By&#039;,																-- contributions to authored works: introduction, foreword, afterword&lt;br /&gt;
	[&#039;cartography&#039;] = &#039;Cartography by $1&#039;,&lt;br /&gt;
	[&#039;editor&#039;] = &#039;ed.&#039;,&lt;br /&gt;
	[&#039;editors&#039;] = &#039;eds.&#039;,&lt;br /&gt;
	[&#039;edition&#039;] = &#039;($1&amp;amp;nbsp;ed.)&#039;,&lt;br /&gt;
	[&#039;episode&#039;] = &#039;Episode $1&#039;,&lt;br /&gt;
	[&#039;et al&#039;] = &#039;et&amp;amp;nbsp;al.&#039;,&lt;br /&gt;
	[&#039;in&#039;] = &#039;In&#039;,																-- edited works&lt;br /&gt;
	[&#039;inactive&#039;] = &#039;inactive&#039;,&lt;br /&gt;
	[&#039;inset&#039;] = &#039;$1 inset&#039;,&lt;br /&gt;
	[&#039;interview&#039;] = &#039;Interviewed by $1&#039;,										&lt;br /&gt;
	[&#039;mismatch&#039;] = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; / &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt; mismatch&#039;,	-- $1 is year param name; $2 is date param name&lt;br /&gt;
	[&#039;newsgroup&#039;] = &#039;[[Usenet newsgroup|Newsgroup]]:&amp;amp;nbsp;$1&#039;,&lt;br /&gt;
	[&#039;notitle&#039;] = &#039;No title&#039;,													-- for |title=(()) and (in the future) |title=none&lt;br /&gt;
	[&#039;original&#039;] = &#039;the original&#039;,&lt;br /&gt;
	[&#039;origdate&#039;] = &#039; [$1]&#039;,&lt;br /&gt;
	[&#039;published&#039;] = &#039; (published $1)&#039;,&lt;br /&gt;
	[&#039;retrieved&#039;] = &#039;Retrieved $1&#039;,&lt;br /&gt;
	[&#039;season&#039;] = &#039;Season $1&#039;,&lt;br /&gt;
	[&#039;section&#039;] = &#039;§&amp;amp;nbsp;$1&#039;,&lt;br /&gt;
	[&#039;sections&#039;] = &#039;§§&amp;amp;nbsp;$1&#039;,&lt;br /&gt;
	[&#039;series&#039;] = &#039;$1 $2&#039;,														-- $1 is sepc, $2 is series&lt;br /&gt;
	[&#039;seriesnum&#039;] = &#039;Series $1&#039;,&lt;br /&gt;
	[&#039;translated&#039;] = &#039;Translated by $1&#039;,&lt;br /&gt;
	[&#039;type&#039;] = &#039; ($1)&#039;,															-- for titletype&lt;br /&gt;
	[&#039;written&#039;] = &#039;Written at $1&#039;,&lt;br /&gt;
&lt;br /&gt;
	[&#039;vol&#039;] = &#039;$1 Vol.&amp;amp;nbsp;$2&#039;,												-- $1 is sepc; bold journal style volume is in presentation{}&lt;br /&gt;
	[&#039;vol-no&#039;] = &#039;$1 Vol.&amp;amp;nbsp;$2, no.&amp;amp;nbsp;$3&#039;,								-- sepc, volume, issue (alternatively insert $1 after $2, but then we&#039;d also have to change capitalization)&lt;br /&gt;
	[&#039;issue&#039;] = &#039;$1 No.&amp;amp;nbsp;$2&#039;,												-- $1 is sepc&lt;br /&gt;
&lt;br /&gt;
	[&#039;art&#039;] = &#039;$1 Art.&amp;amp;nbsp;$2&#039;,												-- $1 is sepc; for {{cite conference}} only&lt;br /&gt;
	[&#039;vol-art&#039;] = &#039;$1 Vol.&amp;amp;nbsp;$2, art.&amp;amp;nbsp;$3&#039;,								-- sepc, volume, article-number; for {{cite conference}} only&lt;br /&gt;
&lt;br /&gt;
	[&#039;j-vol&#039;] = &#039;$1 $2&#039;,														-- sepc, volume; bold journal volume is in presentation{}&lt;br /&gt;
	[&#039;j-issue&#039;] = &#039; ($1)&#039;,&lt;br /&gt;
	[&#039;j-article-num&#039;] = &#039; $1&#039;,													-- TODO: any punctuation here? static text?&lt;br /&gt;
&lt;br /&gt;
	[&#039;nopp&#039;] = &#039;$1 $2&#039;;															-- page(s) without prefix; $1 is sepc&lt;br /&gt;
&lt;br /&gt;
	[&#039;p-prefix&#039;] = &amp;quot;$1 p.&amp;amp;nbsp;$2&amp;quot;,												-- $1 is sepc&lt;br /&gt;
	[&#039;pp-prefix&#039;] = &amp;quot;$1 pp.&amp;amp;nbsp;$2&amp;quot;,											-- $1 is sepc&lt;br /&gt;
	[&#039;j-page(s)&#039;] = &#039;: $1&#039;,														-- same for page and pages&lt;br /&gt;
&lt;br /&gt;
	[&#039;sheet&#039;] = &#039;$1 Sheet&amp;amp;nbsp;$2&#039;,												-- $1 is sepc&lt;br /&gt;
	[&#039;sheets&#039;] = &#039;$1 Sheets&amp;amp;nbsp;$2&#039;,											-- $1 is sepc&lt;br /&gt;
	[&#039;j-sheet&#039;] = &#039;: Sheet&amp;amp;nbsp;$1&#039;,&lt;br /&gt;
	[&#039;j-sheets&#039;] = &#039;: Sheets&amp;amp;nbsp;$1&#039;,&lt;br /&gt;
	&lt;br /&gt;
	[&#039;language&#039;] = &#039;(in $1)&#039;,&lt;br /&gt;
	[&#039;via&#039;] = &amp;quot; &amp;amp;ndash; via $1&amp;quot;,&lt;br /&gt;
	[&#039;event&#039;] = &#039;Event occurs at&#039;,&lt;br /&gt;
	[&#039;minutes&#039;] = &#039;minutes in&#039;,&lt;br /&gt;
	&lt;br /&gt;
	-- Determines the location of the help page&lt;br /&gt;
	[&#039;help page link&#039;] = &#039;Help:CS1 errors&#039;,&lt;br /&gt;
	[&#039;help page label&#039;] = &#039;help&#039;,&lt;br /&gt;
	&lt;br /&gt;
	-- categories&lt;br /&gt;
	[&#039;cat wikilink&#039;] = &#039;[[Category:$1]]&#039;,										-- $1 is the category name&lt;br /&gt;
	[&#039;cat wikilink sk&#039;] = &#039;[[Category:$1|$2]]&#039;,									-- $1 is the category name; $2 is namespace sort key&lt;br /&gt;
	[&#039;:cat wikilink&#039;] = &#039;[[:Category:$1|link]]&#039;,								-- category name as maintenance message wikilink; $1 is the category name&lt;br /&gt;
&lt;br /&gt;
	-- Internal errors (should only occur if configuration is bad)&lt;br /&gt;
	[&#039;undefined_error&#039;] = &#039;Called with an undefined error condition&#039;,&lt;br /&gt;
	[&#039;unknown_ID_key&#039;] = &#039;Unrecognized ID key: &#039;,								-- an ID key in id_handlers not found in ~/Identifiers func_map{}&lt;br /&gt;
	[&#039;unknown_ID_access&#039;] = &#039;Unrecognized ID access keyword: &#039;,					-- an ID access keyword in id_handlers not found in keywords_lists[&#039;id-access&#039;]{}&lt;br /&gt;
	[&#039;unknown_argument_map&#039;] = &#039;Argument map not defined for this variable&#039;,&lt;br /&gt;
	[&#039;bare_url_no_origin&#039;] = &#039;Bare URL found but origin indicator is nil or empty&#039;,&lt;br /&gt;
	&lt;br /&gt;
	[&#039;warning_msg_e&#039;] = &#039;&amp;lt;span style=&amp;quot;color:#d33&amp;quot;&amp;gt;One or more &amp;lt;code style=&amp;quot;color: inherit; background: inherit; border: none; padding: inherit;&amp;quot;&amp;gt;&amp;amp;#123;{$1}}&amp;lt;/code&amp;gt; templates have errors&amp;lt;/span&amp;gt;; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).&#039;;	-- $1 is template link&lt;br /&gt;
	[&#039;warning_msg_m&#039;] = &#039;&amp;lt;span style=&amp;quot;color:#085&amp;quot;&amp;gt;One or more &amp;lt;code style=&amp;quot;color: inherit; background: inherit; border: none; padding: inherit;&amp;quot;&amp;gt;&amp;amp;#123;{$1}}&amp;lt;/code&amp;gt; templates have maintenance messages&amp;lt;/span&amp;gt;; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]]).&#039;;	-- $1 is template link&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C I T A T I O N _ C L A S S _ M A P &amp;gt;------------------------------------------&lt;br /&gt;
&lt;br /&gt;
this table maps the value assigned to |CitationClass= in the cs1|2 templates to the canonical template name when&lt;br /&gt;
the value assigned to |CitationClass= is different from the canonical template name.  |CitationClass= values are&lt;br /&gt;
used as class attributes in the &amp;lt;cite&amp;gt; tag that encloses the citation so these names may not contain spaces while&lt;br /&gt;
the canonical template name may.  These names are used in warning_msg_e and warning_msg_m to create links to the&lt;br /&gt;
template&#039;s documentation when an article is displayed in preview mode.&lt;br /&gt;
&lt;br /&gt;
Most cs1|2 template |CitationClass= values at en.wiki match their canonical template names so are not listed here.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
	local citation_class_map_t = {												-- TODO: if kept, these and all other config.CitationClass &#039;names&#039; require some sort of i18n&lt;br /&gt;
		[&#039;arxiv&#039;] = &#039;arXiv&#039;,&lt;br /&gt;
		[&#039;audio-visual&#039;] = &#039;AV media&#039;,&lt;br /&gt;
		[&#039;AV-media-notes&#039;] = &#039;AV media notes&#039;,&lt;br /&gt;
		[&#039;biorxiv&#039;] = &#039;bioRxiv&#039;,&lt;br /&gt;
		[&#039;citeseerx&#039;] = &#039;CiteSeerX&#039;,&lt;br /&gt;
		[&#039;encyclopaedia&#039;] = &#039;encyclopedia&#039;,&lt;br /&gt;
		[&#039;mailinglist&#039;] = &#039;mailing list&#039;,&lt;br /&gt;
		[&#039;medrxiv&#039;] = &#039;medRxiv&#039;,&lt;br /&gt;
		[&#039;pressrelease&#039;] = &#039;press release&#039;,&lt;br /&gt;
		[&#039;ssrn&#039;] = &#039;SSRN&#039;,&lt;br /&gt;
		[&#039;techreport&#039;] = &#039;tech report&#039;,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; E T _ A L _ P A T T E R N S &amp;gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This table provides Lua patterns for the phrase &amp;quot;et al&amp;quot; and variants in name text&lt;br /&gt;
(author, editor, etc.). The main module uses these to identify and emit the &#039;etal&#039; message.&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local et_al_patterns = {&lt;br /&gt;
	&amp;quot;[;,]? *[\&amp;quot;&#039;]*%f[%a][Ee][Tt]%.? *[Aa][Ll][%.;,\&amp;quot;&#039;]*$&amp;quot;,						-- variations on the &#039;et al&#039; theme&lt;br /&gt;
	&amp;quot;[;,]? *[\&amp;quot;&#039;]*%f[%a][Ee][Tt]%.? *[Aa][Ll][Ii][AaIi][Ee]?[%.;,\&amp;quot;&#039;]*$&amp;quot;,		-- variations on the &#039;et alia&#039;, &#039;et alii&#039; and &#039;et aliae&#039; themes (false positive &#039;et aliie&#039; unlikely to match)&lt;br /&gt;
	&amp;quot;[;,]? *%f[%a]and [Oo]thers&amp;quot;,												-- an alternative to et al.&lt;br /&gt;
	&amp;quot;%[%[ *[Ee][Tt]%.? *[Aa][Ll]%.? *%]%]&amp;quot;,										-- a wikilinked form&lt;br /&gt;
	&amp;quot;%(%( *[Ee][Tt]%.? *[Aa][Ll]%.? *%)%)&amp;quot;,										-- a double-bracketed form (to counter partial removal of ((...)) syntax)&lt;br /&gt;
	&amp;quot;[%(%[] *[Ee][Tt]%.? *[Aa][Ll]%.? *[%)%]]&amp;quot;,									-- a bracketed form&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; P R E S E N T A T I O N &amp;gt;------------------------&lt;br /&gt;
&lt;br /&gt;
Fixed presentation markup.  Originally part of citation_config.messages it has&lt;br /&gt;
been moved into its own, more semantically correct place.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local presentation = &lt;br /&gt;
	{&lt;br /&gt;
	-- .citation-comment class is specified at Help:CS1_errors#Controlling_error_message_display&lt;br /&gt;
	[&#039;hidden-error&#039;] = &#039;&amp;lt;span class=&amp;quot;cs1-hidden-error citation-comment&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
	[&#039;visible-error&#039;] = &#039;&amp;lt;span class=&amp;quot;cs1-visible-error citation-comment&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
	[&#039;hidden-maint&#039;] = &#039;&amp;lt;span class=&amp;quot;cs1-maint citation-comment&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
	&lt;br /&gt;
	[&#039;accessdate&#039;] = &#039;&amp;lt;span class=&amp;quot;reference-accessdate&amp;quot;&amp;gt;$1$2&amp;lt;/span&amp;gt;&#039;,			-- to allow editors to hide accessdate using personal CSS&lt;br /&gt;
&lt;br /&gt;
	[&#039;bdi&#039;] = &#039;&amp;lt;bdi$1&amp;gt;$2&amp;lt;/bdi&amp;gt;&#039;,												-- bidirectional isolation used with |script-title= and the like&lt;br /&gt;
&lt;br /&gt;
	[&#039;cite&#039;] = &#039;&amp;lt;cite class=&amp;quot;$1&amp;quot;&amp;gt;$2&amp;lt;/cite&amp;gt;&#039;;									-- for use when citation does not have a namelist and |ref= not set so no id=&amp;quot;...&amp;quot; attribute&lt;br /&gt;
	[&#039;cite-id&#039;] = &#039;&amp;lt;cite id=&amp;quot;$1&amp;quot; class=&amp;quot;$2&amp;quot;&amp;gt;$3&amp;lt;/cite&amp;gt;&#039;;							-- for use when when |ref= is set or when citation has a namelist&lt;br /&gt;
&lt;br /&gt;
	[&#039;format&#039;] = &#039; &amp;lt;span class=&amp;quot;cs1-format&amp;quot;&amp;gt;($1)&amp;lt;/span&amp;gt;&#039;,						-- for |format=, |chapter-format=, etc.&lt;br /&gt;
	[&#039;interwiki&#039;] = &#039; &amp;lt;span class=&amp;quot;cs1-format&amp;quot;&amp;gt;[in $1]&amp;lt;/span&amp;gt;&#039;,					-- for interwiki-language-linked author, editor, etc&lt;br /&gt;
	[&#039;interproj&#039;] = &#039; &amp;lt;span class=&amp;quot;cs1-format&amp;quot;&amp;gt;[at $1]&amp;lt;/span&amp;gt;&#039;,					-- for interwiki-project-linked author, editor, etc (:d: and :s: supported; :w: ignored)&lt;br /&gt;
&lt;br /&gt;
	-- various access levels, for |access=, |doi-access=, |arxiv=, ...&lt;br /&gt;
	-- narrow no-break space &amp;amp;#8239; may work better than nowrap CSS. Or not? Browser support?&lt;br /&gt;
&lt;br /&gt;
	[&#039;ext-link-access-signal&#039;] = &#039;&amp;lt;span class=&amp;quot;$1&amp;quot; title=&amp;quot;$2&amp;quot;&amp;gt;$3&amp;lt;/span&amp;gt;&#039;,		-- external link with appropriate lock icon&lt;br /&gt;
		[&#039;free&#039;] = {class=&#039;id-lock-free&#039;, title=&#039;Freely accessible&#039;},			-- classes defined in Module:Citation/CS1/styles.css&lt;br /&gt;
		[&#039;registration&#039;] = {class=&#039;id-lock-registration&#039;, title=&#039;Free registration required&#039;},&lt;br /&gt;
		[&#039;limited&#039;] = {class=&#039;id-lock-limited&#039;, title=&#039;Free access subject to limited trial, subscription normally required&#039;},&lt;br /&gt;
		[&#039;subscription&#039;] = {class=&#039;id-lock-subscription&#039;, title=&#039;Paid subscription required&#039;},&lt;br /&gt;
&lt;br /&gt;
	[&#039;interwiki-icon&#039;] = &#039;&amp;lt;span class=&amp;quot;$1&amp;quot; title=&amp;quot;$2&amp;quot;&amp;gt;$3&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
		[&#039;class-wikisource&#039;] = &#039;cs1-ws-icon&#039;,&lt;br /&gt;
&lt;br /&gt;
	[&#039;italic-title&#039;] = &amp;quot;&#039;&#039;$1&#039;&#039;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	[&#039;kern-left&#039;] = &#039;&amp;lt;span class=&amp;quot;cs1-kern-left&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;$1&#039;,					-- spacing to use when title contains leading single or double quote mark&lt;br /&gt;
	[&#039;kern-right&#039;] = &#039;$1&amp;lt;span class=&amp;quot;cs1-kern-right&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;,					-- spacing to use when title contains trailing single or double quote mark&lt;br /&gt;
&lt;br /&gt;
	[&#039;nowrap1&#039;] = &#039;&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;&#039;,								-- for nowrapping an item: &amp;lt;span ...&amp;gt;yyyy-mm-dd&amp;lt;/span&amp;gt;&lt;br /&gt;
	[&#039;nowrap2&#039;] = &#039;&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt; $2&#039;,							-- for nowrapping portions of an item: &amp;lt;span ...&amp;gt;dd mmmm&amp;lt;/span&amp;gt; yyyy (note white space)&lt;br /&gt;
&lt;br /&gt;
	[&#039;ocins&#039;] = &#039;&amp;lt;span title=&amp;quot;$1&amp;quot; class=&amp;quot;Z3988&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;,&lt;br /&gt;
	&lt;br /&gt;
	[&#039;parameter&#039;] = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,&lt;br /&gt;
	&lt;br /&gt;
	[&#039;ps_cs1&#039;] = &#039;.&#039;;															-- CS1 style postscript (terminal) character&lt;br /&gt;
	[&#039;ps_cs2&#039;] = &#039;&#039;;															-- CS2 style postscript (terminal) character (empty string)&lt;br /&gt;
&lt;br /&gt;
	[&#039;quoted-text&#039;] = &#039;&amp;lt;q&amp;gt;$1&amp;lt;/q&amp;gt;&#039;,												-- for wrapping |quote= content&lt;br /&gt;
	[&#039;quoted-title&#039;] = &#039;&amp;quot;$1&amp;quot;&#039;,&lt;br /&gt;
&lt;br /&gt;
	[&#039;sep_cs1&#039;] = &#039;.&#039;,															-- CS1 element separator&lt;br /&gt;
	[&#039;sep_cs2&#039;] = &#039;,&#039;,															-- CS2 separator&lt;br /&gt;
	[&#039;sep_nl&#039;] = &#039;;&#039;,															-- CS1|2 style name-list separator between names is a semicolon&lt;br /&gt;
	[&#039;sep_nl_and&#039;] = &#039; and &#039;,													-- used as last nl sep when |name-list-style=and and list has 2 items&lt;br /&gt;
	[&#039;sep_nl_end&#039;] = &#039;; and &#039;,													-- used as last nl sep when |name-list-style=and and list has 3+ names&lt;br /&gt;
	[&#039;sep_name&#039;] = &#039;, &#039;,														-- CS1|2 style last/first separator is &amp;lt;comma&amp;gt;&amp;lt;space&amp;gt;&lt;br /&gt;
	[&#039;sep_nl_vanc&#039;] = &#039;,&#039;,														-- Vancouver style name-list separator between authors is a comma&lt;br /&gt;
	[&#039;sep_name_vanc&#039;] = &#039; &#039;,													-- Vancouver style last/first separator is a space&lt;br /&gt;
&lt;br /&gt;
	[&#039;sep_list&#039;] = &#039;, &#039;,														-- used for |language= when list has 3+ items except for last sep which uses sep_list_end&lt;br /&gt;
	[&#039;sep_list_pair&#039;] = &#039; and &#039;,												-- used for |language= when list has 2 items&lt;br /&gt;
	[&#039;sep_list_end&#039;] = &#039;, and &#039;,												-- used as last list sep for |language= when list has 3+ items&lt;br /&gt;
	&lt;br /&gt;
	[&#039;trans-italic-title&#039;] = &amp;quot;&amp;amp;#91;&#039;&#039;$1&#039;&#039;&amp;amp;#93;&amp;quot;,&lt;br /&gt;
	[&#039;trans-quoted-title&#039;] = &amp;quot;&amp;amp;#91;$1&amp;amp;#93;&amp;quot;,									-- for |trans-title= and |trans-quote=&lt;br /&gt;
	[&#039;vol-bold&#039;] = &#039;$1 &amp;lt;b&amp;gt;$2&amp;lt;/b&amp;gt;&#039;,												-- sepc, volume; for bold journal cites; for other cites [&#039;vol&#039;] in messages{}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
--[[--------------------------&amp;lt; A L I A S E S &amp;gt;---------------------------------&lt;br /&gt;
&lt;br /&gt;
Aliases table for commonly passed parameters.&lt;br /&gt;
&lt;br /&gt;
Parameter names on the right side in the assignments in this table must have been&lt;br /&gt;
defined in the Whitelist before they will be recognized as valid parameter names&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local aliases = {&lt;br /&gt;
	[&#039;AccessDate&#039;] = {&#039;access-date&#039;, &#039;accessdate&#039;},								-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Agency&#039;] = &#039;agency&#039;,&lt;br /&gt;
	[&#039;ArchiveDate&#039;] = {&#039;archive-date&#039;, &#039;archivedate&#039;},							-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;ArchiveFormat&#039;] = &#039;archive-format&#039;,&lt;br /&gt;
	[&#039;ArchiveURL&#039;] = {&#039;archive-url&#039;, &#039;archiveurl&#039;},								-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;ArticleNumber&#039;] = &#039;article-number&#039;,&lt;br /&gt;
	[&#039;ASINTLD&#039;] = &#039;asin-tld&#039;,&lt;br /&gt;
	[&#039;At&#039;] = &#039;at&#039;,																-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Authors&#039;] = {&#039;people&#039;, &#039;credits&#039;},&lt;br /&gt;
	[&#039;BookTitle&#039;] = {&#039;book-title&#039;, &#039;booktitle&#039;},&lt;br /&gt;
	[&#039;Cartography&#039;] = &#039;cartography&#039;,&lt;br /&gt;
	[&#039;Chapter&#039;] = {&#039;chapter&#039;, &#039;contribution&#039;, &#039;entry&#039;, &#039;article&#039;, &#039;section&#039;},&lt;br /&gt;
	[&#039;ChapterFormat&#039;] = {&#039;chapter-format&#039;, &#039;contribution-format&#039;, &#039;entry-format&#039;,&lt;br /&gt;
		&#039;article-format&#039;, &#039;section-format&#039;};&lt;br /&gt;
	[&#039;ChapterURL&#039;] = {&#039;chapter-url&#039;, &#039;contribution-url&#039;, &#039;entry-url&#039;, &#039;article-url&#039;, &#039;section-url&#039;},	-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;ChapterUrlAccess&#039;] = {&#039;chapter-url-access&#039;, &#039;contribution-url-access&#039;,&lt;br /&gt;
		&#039;entry-url-access&#039;, &#039;article-url-access&#039;, &#039;section-url-access&#039;},		-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Class&#039;] = &#039;class&#039;,														-- cite arxiv and arxiv identifier&lt;br /&gt;
	[&#039;Collaboration&#039;] = &#039;collaboration&#039;,&lt;br /&gt;
	[&#039;Conference&#039;] = {&#039;conference&#039;, &#039;event&#039;},&lt;br /&gt;
	[&#039;ConferenceFormat&#039;] = &#039;conference-format&#039;,&lt;br /&gt;
	[&#039;ConferenceURL&#039;] = &#039;conference-url&#039;,										-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Date&#039;] = {&#039;date&#039;, &#039;air-date&#039;, &#039;airdate&#039;},									-- air-date and airdate for cite episode and cite serial only&lt;br /&gt;
	[&#039;Degree&#039;] = &#039;degree&#039;,&lt;br /&gt;
	[&#039;DF&#039;] = &#039;df&#039;,&lt;br /&gt;
	[&#039;DisplayAuthors&#039;] = {&#039;display-authors&#039;, &#039;display-subjects&#039;},&lt;br /&gt;
	[&#039;DisplayContributors&#039;] = &#039;display-contributors&#039;,&lt;br /&gt;
	[&#039;DisplayEditors&#039;] = &#039;display-editors&#039;,&lt;br /&gt;
	[&#039;DisplayInterviewers&#039;] = &#039;display-interviewers&#039;,&lt;br /&gt;
	[&#039;DisplayTranslators&#039;] = &#039;display-translators&#039;,&lt;br /&gt;
	[&#039;Docket&#039;] = &#039;docket&#039;,&lt;br /&gt;
	[&#039;DoiBroken&#039;] = &#039;doi-broken-date&#039;,&lt;br /&gt;
	[&#039;Edition&#039;] = &#039;edition&#039;,&lt;br /&gt;
	[&#039;Embargo&#039;] = &#039;pmc-embargo-date&#039;,&lt;br /&gt;
	[&#039;Encyclopedia&#039;] = {&#039;encyclopedia&#039;, &#039;encyclopaedia&#039;, &#039;dictionary&#039;},			-- cite encyclopedia only&lt;br /&gt;
	[&#039;Episode&#039;] = &#039;episode&#039;,													-- cite serial only TODO: make available to cite episode?&lt;br /&gt;
	[&#039;Format&#039;] = &#039;format&#039;,&lt;br /&gt;
	[&#039;ID&#039;] = {&#039;id&#039;, &#039;ID&#039;},&lt;br /&gt;
	[&#039;Inset&#039;] = &#039;inset&#039;,&lt;br /&gt;
	[&#039;Issue&#039;] = {&#039;issue&#039;, &#039;number&#039;},&lt;br /&gt;
	[&#039;Language&#039;] = {&#039;language&#039;, &#039;lang&#039;},&lt;br /&gt;
	[&#039;MailingList&#039;] = {&#039;mailing-list&#039;, &#039;mailinglist&#039;},							-- cite mailing list only&lt;br /&gt;
	[&#039;Map&#039;] = &#039;map&#039;,															-- cite map only&lt;br /&gt;
	[&#039;MapFormat&#039;] = &#039;map-format&#039;,												-- cite map only&lt;br /&gt;
	[&#039;MapURL&#039;] = {&#039;map-url&#039;, &#039;mapurl&#039;},											-- cite map only -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;MapUrlAccess&#039;] = &#039;map-url-access&#039;,										-- cite map only -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Minutes&#039;] = &#039;minutes&#039;,&lt;br /&gt;
	[&#039;Mode&#039;] = &#039;mode&#039;,&lt;br /&gt;
	[&#039;NameListStyle&#039;] = &#039;name-list-style&#039;,&lt;br /&gt;
	[&#039;Network&#039;] = &#039;network&#039;,&lt;br /&gt;
	[&#039;Newsgroup&#039;] = &#039;newsgroup&#039;,												-- cite newsgroup only&lt;br /&gt;
	[&#039;NoPP&#039;] = {&#039;no-pp&#039;, &#039;nopp&#039;},&lt;br /&gt;
	[&#039;NoTracking&#039;] = {&#039;no-tracking&#039;, &#039;template-doc-demo&#039;},&lt;br /&gt;
	[&#039;Number&#039;] = &#039;number&#039;,														-- this case only for cite techreport&lt;br /&gt;
	[&#039;OrigDate&#039;] = {&#039;orig-date&#039;, &#039;orig-year&#039;, &#039;origyear&#039;},&lt;br /&gt;
	[&#039;Others&#039;] = &#039;others&#039;,&lt;br /&gt;
	[&#039;Page&#039;] = {&#039;page&#039;, &#039;p&#039;},													-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Pages&#039;] = {&#039;pages&#039;, &#039;pp&#039;},												-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Periodical&#039;] = {&#039;journal&#039;, &#039;magazine&#039;, &#039;newspaper&#039;, &#039;periodical&#039;, &#039;website&#039;, &#039;work&#039;},&lt;br /&gt;
	[&#039;Place&#039;] = {&#039;place&#039;, &#039;location&#039;},&lt;br /&gt;
	[&#039;PostScript&#039;] = &#039;postscript&#039;,&lt;br /&gt;
	[&#039;PublicationDate&#039;] = {&#039;publication-date&#039;, &#039;publicationdate&#039;},&lt;br /&gt;
	[&#039;PublicationPlace&#039;] = {&#039;publication-place&#039;, &#039;publicationplace&#039;},&lt;br /&gt;
	[&#039;PublisherName&#039;] = {&#039;publisher&#039;, &#039;institution&#039;},&lt;br /&gt;
	[&#039;Quote&#039;] = {&#039;quote&#039;, &#039;quotation&#039;},&lt;br /&gt;
	[&#039;QuotePage&#039;] = &#039;quote-page&#039;,&lt;br /&gt;
	[&#039;QuotePages&#039;] = &#039;quote-pages&#039;,&lt;br /&gt;
	[&#039;Ref&#039;] = &#039;ref&#039;,&lt;br /&gt;
	[&#039;Scale&#039;] = &#039;scale&#039;,&lt;br /&gt;
	[&#039;ScriptChapter&#039;] = {&#039;script-chapter&#039;, &#039;script-contribution&#039;, &#039;script-entry&#039;,&lt;br /&gt;
		&#039;script-article&#039;, &#039;script-section&#039;},&lt;br /&gt;
	[&#039;ScriptEncyclopedia&#039;] = {&#039;script-encyclopedia&#039;, &#039;script-encyclopaedia&#039;},	-- cite encyclopedia only&lt;br /&gt;
	[&#039;ScriptMap&#039;] = &#039;script-map&#039;,&lt;br /&gt;
	[&#039;ScriptPeriodical&#039;] = {&#039;script-journal&#039;, &#039;script-magazine&#039;, &#039;script-newspaper&#039;,&lt;br /&gt;
		&#039;script-periodical&#039;, &#039;script-website&#039;, &#039;script-work&#039;},&lt;br /&gt;
	[&#039;ScriptQuote&#039;] = &#039;script-quote&#039;,&lt;br /&gt;
	[&#039;ScriptTitle&#039;] = &#039;script-title&#039;,											-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Season&#039;] = &#039;season&#039;,&lt;br /&gt;
	[&#039;Sections&#039;] = &#039;sections&#039;,													-- cite map only&lt;br /&gt;
	[&#039;Series&#039;] = {&#039;series&#039;, &#039;version&#039;},&lt;br /&gt;
	[&#039;SeriesLink&#039;] = {&#039;series-link&#039;, &#039;serieslink&#039;},&lt;br /&gt;
	[&#039;SeriesNumber&#039;] = {&#039;series-number&#039;, &#039;series-no&#039;},&lt;br /&gt;
	[&#039;Sheet&#039;] = &#039;sheet&#039;,														-- cite map only&lt;br /&gt;
	[&#039;Sheets&#039;] = &#039;sheets&#039;,														-- cite map only&lt;br /&gt;
	[&#039;Station&#039;] = &#039;station&#039;,&lt;br /&gt;
	[&#039;Time&#039;] = &#039;time&#039;,&lt;br /&gt;
	[&#039;TimeCaption&#039;] = &#039;time-caption&#039;,&lt;br /&gt;
	[&#039;Title&#039;] = &#039;title&#039;,														-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;TitleLink&#039;] = {&#039;title-link&#039;, &#039;episode-link&#039;, &#039;episodelink&#039;},				-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;TitleNote&#039;] = {&#039;title-note&#039;, &#039;department&#039;},&lt;br /&gt;
	[&#039;TitleType&#039;] = {&#039;type&#039;, &#039;medium&#039;},&lt;br /&gt;
	[&#039;TransChapter&#039;] = {&#039;trans-article&#039;, &#039;trans-chapter&#039;, &#039;trans-contribution&#039;,&lt;br /&gt;
		&#039;trans-entry&#039;, &#039;trans-section&#039;},&lt;br /&gt;
	[&#039;Transcript&#039;] = &#039;transcript&#039;,&lt;br /&gt;
	[&#039;TranscriptFormat&#039;] = &#039;transcript-format&#039;,	&lt;br /&gt;
	[&#039;TranscriptURL&#039;] = &#039;transcript-url&#039;,										-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;TransEncyclopedia&#039;] = {&#039;trans-encyclopedia&#039;, &#039;trans-encyclopaedia&#039;},		-- cite encyclopedia only&lt;br /&gt;
	[&#039;TransMap&#039;] = &#039;trans-map&#039;,													-- cite map only&lt;br /&gt;
	[&#039;TransPeriodical&#039;] = {&#039;trans-journal&#039;, &#039;trans-magazine&#039;, &#039;trans-newspaper&#039;,&lt;br /&gt;
		&#039;trans-periodical&#039;, &#039;trans-website&#039;, &#039;trans-work&#039;},&lt;br /&gt;
	[&#039;TransQuote&#039;] = &#039;trans-quote&#039;,&lt;br /&gt;
	[&#039;TransTitle&#039;] = &#039;trans-title&#039;,												-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;URL&#039;] = {&#039;url&#039;, &#039;URL&#039;},													-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;UrlAccess&#039;] = &#039;url-access&#039;,												-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;UrlStatus&#039;] = &#039;url-status&#039;,												-- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;Vauthors&#039;] = &#039;vauthors&#039;,&lt;br /&gt;
	[&#039;Veditors&#039;] = &#039;veditors&#039;,&lt;br /&gt;
	[&#039;Via&#039;] = &#039;via&#039;,&lt;br /&gt;
	[&#039;Volume&#039;] = &#039;volume&#039;,&lt;br /&gt;
	[&#039;Year&#039;] = &#039;year&#039;,&lt;br /&gt;
&lt;br /&gt;
	[&#039;AuthorList-First&#039;] = {&amp;quot;first#&amp;quot;, &amp;quot;author-first#&amp;quot;, &amp;quot;author#-first&amp;quot;, &amp;quot;author-given#&amp;quot;, &amp;quot;author#-given&amp;quot;,&lt;br /&gt;
		&amp;quot;subject-first#&amp;quot;, &amp;quot;subject#-first&amp;quot;, &amp;quot;subject-given#&amp;quot;, &amp;quot;subject#-given&amp;quot;,&lt;br /&gt;
		&amp;quot;given#&amp;quot;},&lt;br /&gt;
	[&#039;AuthorList-Last&#039;] = {&amp;quot;last#&amp;quot;, &amp;quot;author-last#&amp;quot;, &amp;quot;author#-last&amp;quot;, &amp;quot;author-surname#&amp;quot;, &amp;quot;author#-surname&amp;quot;,&lt;br /&gt;
		&amp;quot;subject-last#&amp;quot;, &amp;quot;subject#-last&amp;quot;, &amp;quot;subject-surname#&amp;quot;, &amp;quot;subject#-surname&amp;quot;,&lt;br /&gt;
		&amp;quot;author#&amp;quot;, &#039;host#&#039;, &amp;quot;subject#&amp;quot;, &amp;quot;surname#&amp;quot;},&lt;br /&gt;
	[&#039;AuthorList-Link&#039;] = {&amp;quot;author-link#&amp;quot;, &amp;quot;author#-link&amp;quot;, &amp;quot;subject-link#&amp;quot;,&lt;br /&gt;
		&amp;quot;subject#-link&amp;quot;, &amp;quot;authorlink#&amp;quot;, &amp;quot;author#link&amp;quot;},&lt;br /&gt;
	[&#039;AuthorList-Mask&#039;] = {&amp;quot;author-mask#&amp;quot;, &amp;quot;author#-mask&amp;quot;, &amp;quot;subject-mask#&amp;quot;, &amp;quot;subject#-mask&amp;quot;},&lt;br /&gt;
&lt;br /&gt;
	[&#039;ContributorList-First&#039;] = {&#039;contributor-first#&#039;, &#039;contributor#-first&#039;,&lt;br /&gt;
		&#039;contributor-given#&#039;, &#039;contributor#-given&#039;},&lt;br /&gt;
	[&#039;ContributorList-Last&#039;] = {&#039;contributor-last#&#039;, &#039;contributor#-last&#039;,&lt;br /&gt;
		&#039;contributor-surname#&#039;, &#039;contributor#-surname&#039;, &#039;contributor#&#039;},&lt;br /&gt;
	[&#039;ContributorList-Link&#039;] = {&#039;contributor-link#&#039;, &#039;contributor#-link&#039;},&lt;br /&gt;
	[&#039;ContributorList-Mask&#039;] = {&#039;contributor-mask#&#039;, &#039;contributor#-mask&#039;},&lt;br /&gt;
&lt;br /&gt;
	[&#039;EditorList-First&#039;] = {&amp;quot;editor-first#&amp;quot;, &amp;quot;editor#-first&amp;quot;, &amp;quot;editor-given#&amp;quot;, &amp;quot;editor#-given&amp;quot;},&lt;br /&gt;
	[&#039;EditorList-Last&#039;] = {&amp;quot;editor-last#&amp;quot;, &amp;quot;editor#-last&amp;quot;, &amp;quot;editor-surname#&amp;quot;,&lt;br /&gt;
		&amp;quot;editor#-surname&amp;quot;, &amp;quot;editor#&amp;quot;},&lt;br /&gt;
	[&#039;EditorList-Link&#039;] = {&amp;quot;editor-link#&amp;quot;, &amp;quot;editor#-link&amp;quot;},&lt;br /&gt;
	[&#039;EditorList-Mask&#039;] = {&amp;quot;editor-mask#&amp;quot;, &amp;quot;editor#-mask&amp;quot;},&lt;br /&gt;
	&lt;br /&gt;
	[&#039;InterviewerList-First&#039;] = {&#039;interviewer-first#&#039;, &#039;interviewer#-first&#039;,&lt;br /&gt;
		&#039;interviewer-given#&#039;, &#039;interviewer#-given&#039;},&lt;br /&gt;
	[&#039;InterviewerList-Last&#039;] = {&#039;interviewer-last#&#039;, &#039;interviewer#-last&#039;,&lt;br /&gt;
		&#039;interviewer-surname#&#039;, &#039;interviewer#-surname&#039;, &#039;interviewer#&#039;},&lt;br /&gt;
	[&#039;InterviewerList-Link&#039;] = {&#039;interviewer-link#&#039;, &#039;interviewer#-link&#039;},&lt;br /&gt;
	[&#039;InterviewerList-Mask&#039;] = {&#039;interviewer-mask#&#039;, &#039;interviewer#-mask&#039;},&lt;br /&gt;
&lt;br /&gt;
	[&#039;TranslatorList-First&#039;] = {&#039;translator-first#&#039;, &#039;translator#-first&#039;,&lt;br /&gt;
		&#039;translator-given#&#039;, &#039;translator#-given&#039;},&lt;br /&gt;
	[&#039;TranslatorList-Last&#039;] = {&#039;translator-last#&#039;, &#039;translator#-last&#039;,&lt;br /&gt;
		&#039;translator-surname#&#039;, &#039;translator#-surname&#039;, &#039;translator#&#039;},&lt;br /&gt;
	[&#039;TranslatorList-Link&#039;] = {&#039;translator-link#&#039;, &#039;translator#-link&#039;},&lt;br /&gt;
	[&#039;TranslatorList-Mask&#039;] = {&#039;translator-mask#&#039;, &#039;translator#-mask&#039;},&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; P U N C T _ S K I P &amp;gt;---------------------------&lt;br /&gt;
&lt;br /&gt;
builds a table of parameter names that the extraneous terminal punctuation check should not check.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local punct_meta_params = {														-- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value&lt;br /&gt;
	&#039;BookTitle&#039;, &#039;Chapter&#039;, &#039;ScriptChapter&#039;, &#039;ScriptTitle&#039;, &#039;Title&#039;, &#039;TransChapter&#039;, &#039;Transcript&#039;, &#039;TransMap&#039;,	&#039;TransTitle&#039;,	-- title-holding parameters&lt;br /&gt;
	&#039;AuthorList-Mask&#039;, &#039;ContributorList-Mask&#039;, &#039;EditorList-Mask&#039;, &#039;InterviewerList-Mask&#039;, &#039;TranslatorList-Mask&#039;,	-- name-list mask may have name separators&lt;br /&gt;
	&#039;PostScript&#039;, &#039;Quote&#039;, &#039;ScriptQuote&#039;, &#039;TransQuote&#039;, &#039;Ref&#039;,											-- miscellaneous&lt;br /&gt;
	&#039;ArchiveURL&#039;, &#039;ChapterURL&#039;, &#039;ConferenceURL&#039;, &#039;MapURL&#039;, &#039;TranscriptURL&#039;, &#039;URL&#039;,						-- URL-holding parameters&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
local url_meta_params = {														-- table of aliases[] keys (meta parameters); each key has a table of parameter names for a value&lt;br /&gt;
	&#039;ArchiveURL&#039;, &#039;ChapterURL&#039;, &#039;ConferenceURL&#039;, &#039;ID&#039;, &#039;MapURL&#039;, &#039;TranscriptURL&#039;, &#039;URL&#039;,		-- parameters allowed to hold urls&lt;br /&gt;
	&#039;Page&#039;, &#039;Pages&#039;, &#039;At&#039;, &#039;QuotePage&#039;, &#039;QuotePages&#039;,							-- insource locators allowed to hold urls&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
local function build_skip_table (skip_t, meta_params)&lt;br /&gt;
	for _, meta_param in ipairs (meta_params) do								-- for each meta parameter key&lt;br /&gt;
		local params = aliases[meta_param];										-- get the parameter or the table of parameters associated with the meta parameter name&lt;br /&gt;
		if &#039;string&#039; == type (params) then&lt;br /&gt;
			skip_t[params] = 1;													-- just a single parameter&lt;br /&gt;
		else&lt;br /&gt;
			for _, param in ipairs (params) do									-- get the parameter name&lt;br /&gt;
				skip_t[param] = 1;												-- add the parameter name to the skip table&lt;br /&gt;
				local count;&lt;br /&gt;
				param, count = param:gsub (&#039;#&#039;, &#039;&#039;);							-- remove enumerator marker from enumerated parameters&lt;br /&gt;
				if 0 ~= count then												-- if removed&lt;br /&gt;
					skip_t[param] = 1;											-- add param name without enumerator marker&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return skip_t;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local punct_skip = {};&lt;br /&gt;
local url_skip = {};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; U R L _ A C C E S S _ M A P &amp;gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
this table used by the wikipedia library url test, has_twl_url(), which automatically sets a url-access parameter&lt;br /&gt;
to &#039;subscription&#039; when it discovers a wikipedia library url in any of the url-holding paramters used as keys in&lt;br /&gt;
this table.&lt;br /&gt;
&lt;br /&gt;
translators:  if your wiki uses parameter names for these url-holding parameters and their matching -access parameters,&lt;br /&gt;
add your wiki&#039;s parameters to this list.  Leave the English parameters in place.&lt;br /&gt;
&lt;br /&gt;
TODO: is there a better way to do this?&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local url_access_map_t = {&lt;br /&gt;
	[&#039;chapter-url&#039;] = &#039;chapter-url-access&#039;,&lt;br /&gt;
	[&#039;contribution-url&#039;] = &#039;contribution-url-access&#039;,&lt;br /&gt;
	[&#039;entry-url&#039;] = &#039;entry-url-access&#039;,&lt;br /&gt;
	[&#039;article-url&#039;] = &#039;article-url-access&#039;,&lt;br /&gt;
	[&#039;section-url&#039;] = &#039;section-url-access&#039;,&lt;br /&gt;
	[&#039;map-url&#039;] = &#039;map-url-access&#039;,&lt;br /&gt;
	[&#039;mapurl&#039;] = &#039;map-url-access&#039;,&lt;br /&gt;
	[&#039;url&#039;] = &#039;url-access&#039;,&lt;br /&gt;
	[&#039;URL&#039;] = &#039;url-access&#039;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S I N G L E - L E T T E R   S E C O N D - L E V E L   D O M A I N S &amp;gt;----------&lt;br /&gt;
&lt;br /&gt;
this is a list of tlds that are known to have single-letter second-level domain names.  This list does not include&lt;br /&gt;
ccTLDs which are accepted in is_domain_name().&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local single_letter_2nd_lvl_domains_t = {&#039;cash&#039;, &#039;company&#039;, &#039;foundation&#039;, &#039;media&#039;, &#039;org&#039;, &#039;today&#039;};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-----------&amp;lt; S P E C I A L   C A S E   T R A N S L A T I O N S &amp;gt;------------&lt;br /&gt;
&lt;br /&gt;
This table is primarily here to support internationalization.  Translations in&lt;br /&gt;
this table are used, for example, when an error message, category name, etc.,&lt;br /&gt;
is extracted from the English alias key.  There may be other cases where&lt;br /&gt;
this translation table may be useful.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
local is_Latn = &#039;A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191&#039;;&lt;br /&gt;
local special_case_translation = {&lt;br /&gt;
	[&#039;AuthorList&#039;] = &#039;authors list&#039;,											-- used to assemble maintenance category names&lt;br /&gt;
	[&#039;ContributorList&#039;] = &#039;contributors list&#039;,									-- translation of these names plus translation of the base maintenance category names in maint_cats{} table below&lt;br /&gt;
	[&#039;EditorList&#039;] = &#039;editors list&#039;,											-- must match the names of the actual categories&lt;br /&gt;
	[&#039;InterviewerList&#039;] = &#039;interviewers list&#039;,									-- this group or translations used by name_has_ed_markup() and name_has_mult_names()&lt;br /&gt;
	[&#039;TranslatorList&#039;] = &#039;translators list&#039;,&lt;br /&gt;
	&lt;br /&gt;
																				-- Lua patterns to match pseudo-titles used by InternetArchiveBot and others as placeholder for unknown |title= value&lt;br /&gt;
	[&#039;archived_copy&#039;] = {														-- used with CS1 maint: Archive[d] copy as title&lt;br /&gt;
		[&#039;en&#039;] = &#039;^archived?%s+copy$&#039;,											-- for English; translators: keep this because templates imported from en.wiki&lt;br /&gt;
		[&#039;local&#039;] = nil,														-- translators: replace [&#039;local&#039;] = nil with lowercase translation only when bots or tools create generic titles in your language&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
																				-- Lua patterns to match generic titles; usually created by bots or reference filling tools&lt;br /&gt;
																				-- translators: replace [&#039;local&#039;] = nil with lowercase translation only when bots or tools create generic titles in your language&lt;br /&gt;
		-- generic titles and patterns in this table should be lowercase only&lt;br /&gt;
		-- leave [&#039;local&#039;] nil except when there is a matching generic title in your language&lt;br /&gt;
		-- boolean &#039;true&#039; for plain-text searches; &#039;false&#039; for pattern searches&lt;br /&gt;
&lt;br /&gt;
	[&#039;generic_titles&#039;] = {&lt;br /&gt;
		[&#039;accept&#039;] = {&lt;br /&gt;
			},&lt;br /&gt;
		[&#039;reject&#039;] = {&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^wayback%s+machine$&#039;, false},				[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;are you a robot&#039;, true},					[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;hugedomains&#039;, true},						[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[%(%[{&amp;lt;]?no +title[&amp;gt;}%]%)]?$&#039;, false},		[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;page not found&#039;, true},						[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;subscribe to read&#039;, true},					[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[%(%[{&amp;lt;]?unknown[&amp;gt;}%]%)]?$&#039;, false},		[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;website is for sale&#039;, true},				[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^404&#039;, false},								[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;error[ %-]404&#039;, false},						[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;internet archive wayback machine&#039;, true},	[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;log into facebook&#039;, true},					[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;login • instagram&#039;, true},					[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;redirecting...&#039;, true},						[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;usurped title&#039;, true},						[&#039;local&#039;] = nil},	-- added by a GreenC bot&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;webcite query result&#039;, true},				[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;wikiwix\&#039;s cache&#039;, true},					[&#039;local&#039;] = nil},&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		-- boolean &#039;true&#039; for plain-text searches, search string must be lowercase only&lt;br /&gt;
		-- boolean &#039;false&#039; for pattern searches&lt;br /&gt;
		-- leave [&#039;local&#039;] nil except when there is a matching generic name in your language&lt;br /&gt;
&lt;br /&gt;
	[&#039;generic_names&#039;] = {&lt;br /&gt;
		[&#039;accept&#039;] = {&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%[%[[^|]*%(author%) *|[^%]]*%]%]&#039;, false},				[&#039;local&#039;] = nil},&lt;br /&gt;
			},&lt;br /&gt;
		[&#039;reject&#039;] = {&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;about us&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[%a][Aa]dvisor%f[%A]&#039;, false},						[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;allmusic&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[%a][Aa]uthor%f[%A]&#039;, false},							[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Bb]ureau$&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;business&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;cnn&#039;, true},											[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;collaborator&#039;, true},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Cc]ompany$&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;contributor&#039;, true},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;contact us&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;correspondent&#039;, true},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Dd]esk$&#039;, false},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;directory&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[%(%[][%(%[]%s*eds?%.?%s*[%)%]]?$&#039;, false},			[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;[,%.%s]%f[e]eds?%.?$&#039;, false},							[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^eds?[%.,;]&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[%(%[]%s*[Ee][Dd][Ss]?%.?%s*[%)%]]&#039;, false},			[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[%a][Ee]dited%f[%A]&#039;, false},							[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[%a][Ee]ditors?%f[%A]&#039;, false},						[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[%a][Ee]mail%f[%A]&#039;, false},							[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;facebook&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;google&#039;, true},											[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Gg]roup$&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;home page&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Ii]nc%.?$&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;instagram&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;interviewer&#039;, true},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Ll]imited$&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;linkedIn&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;^[Nn]ews$&#039;, false},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;[Nn]ews[ %-]?[Rr]oom&#039;, false},							[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;pinterest&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;policy&#039;, true},											[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;privacy&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;reuters&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;translator&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;tumblr&#039;, true},											[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;twitter&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;site name&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;statement&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;submitted&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;super.?user&#039;, false},									[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;%f[&#039;..is_Latn..&#039;][Uu]ser%f[^&#039;..is_Latn..&#039;]&#039;, false},	[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;updated&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			{[&#039;en&#039;] = {&#039;verfasser&#039;, true},										[&#039;local&#039;] = nil},&lt;br /&gt;
			}&lt;br /&gt;
	}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; D A T E _ N A M E S &amp;gt;----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This table of tables lists local language date names and fallback English date names.&lt;br /&gt;
The code in Date_validation will look first in the local table for valid date names.&lt;br /&gt;
If date names are not found in the local table, the code will look in the English table.&lt;br /&gt;
&lt;br /&gt;
Because citations can be copied to the local wiki from en.wiki, the English is&lt;br /&gt;
required when the date-name translation function date_name_xlate() is used.&lt;br /&gt;
&lt;br /&gt;
In these tables, season numbering is defined by&lt;br /&gt;
Extended Date/Time Format (EDTF) Specification (https://www.loc.gov/standards/datetime/)&lt;br /&gt;
which became part of ISO 8601 in 2019.  See &#039;§Sub-year groupings&#039;. The standard&lt;br /&gt;
defines various divisions using numbers 21-41. CS1|2 only supports generic seasons.&lt;br /&gt;
EDTF does support the distinction between north and south hemisphere seasons&lt;br /&gt;
but CS1|2 has no way to make that distinction.&lt;br /&gt;
&lt;br /&gt;
33-36 = Quarter 1, Quarter 2, Quarter 3, Quarter 4 (3 months each)&lt;br /&gt;
&lt;br /&gt;
The standard does not address &#039;named&#039; dates so, for the purposes of CS1|2,&lt;br /&gt;
Easter and Christmas are defined here as 98 and 99, which should be out of the&lt;br /&gt;
ISO 8601 (EDTF) range of uses for a while.&lt;br /&gt;
&lt;br /&gt;
local_date_names_from_mediawiki is a boolean.  When set to:&lt;br /&gt;
	true – module will fetch local month names from MediaWiki for both date_names[&#039;local&#039;][&#039;long&#039;] and date_names[&#039;local&#039;][&#039;short&#039;]; this will unconditionally overwrite manual translations&lt;br /&gt;
	false – module will *not* fetch local month names from MediaWiki&lt;br /&gt;
&lt;br /&gt;
Caveat lector:  There is no guarantee that MediaWiki will provide short month names.  At your wiki you can test&lt;br /&gt;
the results of the MediaWiki fetch in the debug console with this command (the result is alpha sorted):&lt;br /&gt;
	=mw.dumpObject (p.date_names[&#039;local&#039;])&lt;br /&gt;
&lt;br /&gt;
While the module can fetch month names from MediaWiki, it cannot fetch the quarter, season, and named date names&lt;br /&gt;
from MediaWiki.  Those must be translated manually.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local local_date_names_from_mediawiki = true;									-- when false, manual translation required for date_names[&#039;local&#039;][&#039;long&#039;] and date_names[&#039;local&#039;][&#039;short&#039;]; overwrites manual translations&lt;br /&gt;
																				-- when true, module fetches long and short month names from MediaWiki&lt;br /&gt;
local date_names = {&lt;br /&gt;
	[&#039;en&#039;] = {																	-- English&lt;br /&gt;
		[&#039;long&#039;]	= {[&#039;January&#039;] = 1, [&#039;February&#039;] = 2, [&#039;March&#039;] = 3, [&#039;April&#039;] = 4, [&#039;May&#039;] = 5, [&#039;June&#039;] = 6, [&#039;July&#039;] = 7, [&#039;August&#039;] = 8, [&#039;September&#039;] = 9, [&#039;October&#039;] = 10, [&#039;November&#039;] = 11, [&#039;December&#039;] = 12},&lt;br /&gt;
		[&#039;short&#039;]	= {[&#039;Jan&#039;] = 1, [&#039;Feb&#039;] = 2, [&#039;Mar&#039;] = 3, [&#039;Apr&#039;] = 4, [&#039;May&#039;] = 5, [&#039;Jun&#039;] = 6, [&#039;Jul&#039;] = 7, [&#039;Aug&#039;] = 8, [&#039;Sep&#039;] = 9, [&#039;Oct&#039;] = 10, [&#039;Nov&#039;] = 11, [&#039;Dec&#039;] = 12},&lt;br /&gt;
		[&#039;quarter&#039;] = {[&#039;First Quarter&#039;] = 33, [&#039;Second Quarter&#039;] = 34, [&#039;Third Quarter&#039;] = 35, [&#039;Fourth Quarter&#039;] = 36},&lt;br /&gt;
		[&#039;season&#039;]	= {[&#039;Winter&#039;] = 24, [&#039;Spring&#039;] = 21, [&#039;Summer&#039;] = 22, [&#039;Fall&#039;] = 23, [&#039;Autumn&#039;] = 23},&lt;br /&gt;
		[&#039;named&#039;]	= {[&#039;Easter&#039;] = 98, [&#039;Christmas&#039;] = 99},&lt;br /&gt;
		},&lt;br /&gt;
																				-- when local_date_names_from_mediawiki = false&lt;br /&gt;
	[&#039;local&#039;] = {																-- replace these English date names with the local language equivalents&lt;br /&gt;
		[&#039;long&#039;]	= {[&#039;January&#039;] = 1, [&#039;February&#039;] = 2, [&#039;March&#039;] = 3, [&#039;April&#039;] = 4, [&#039;May&#039;] = 5, [&#039;June&#039;] = 6, [&#039;July&#039;] = 7, [&#039;August&#039;] = 8, [&#039;September&#039;] = 9, [&#039;October&#039;] = 10, [&#039;November&#039;] = 11, [&#039;December&#039;] = 12},&lt;br /&gt;
		[&#039;short&#039;]	= {[&#039;Jan&#039;] = 1, [&#039;Feb&#039;] = 2, [&#039;Mar&#039;] = 3, [&#039;Apr&#039;] = 4, [&#039;May&#039;] = 5, [&#039;Jun&#039;] = 6, [&#039;Jul&#039;] = 7, [&#039;Aug&#039;] = 8, [&#039;Sep&#039;] = 9, [&#039;Oct&#039;] = 10, [&#039;Nov&#039;] = 11, [&#039;Dec&#039;] = 12},&lt;br /&gt;
		[&#039;quarter&#039;] = {[&#039;First Quarter&#039;] = 33, [&#039;Second Quarter&#039;] = 34, [&#039;Third Quarter&#039;] = 35, [&#039;Fourth Quarter&#039;] = 36},&lt;br /&gt;
		[&#039;season&#039;]	= {[&#039;Winter&#039;] = 24, [&#039;Spring&#039;] = 21, [&#039;Summer&#039;] = 22, [&#039;Fall&#039;] = 23, [&#039;Autumn&#039;] = 23},&lt;br /&gt;
		[&#039;named&#039;]	= {[&#039;Easter&#039;] = 98, [&#039;Christmas&#039;] = 99},&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;inv_local_long&#039;] = {},													-- used in date reformatting &amp;amp; translation; copy of date_names[&#039;local&#039;].long where k/v are inverted: [1]=&#039;&amp;lt;local name&amp;gt;&#039; etc.&lt;br /&gt;
	[&#039;inv_local_short&#039;] = {},													-- used in date reformatting &amp;amp; translation; copy of date_names[&#039;local&#039;].short where k/v are inverted: [1]=&#039;&amp;lt;local name&amp;gt;&#039; etc.&lt;br /&gt;
	[&#039;inv_local_quarter&#039;] = {},													-- used in date translation; copy of date_names[&#039;local&#039;].quarter where k/v are inverted: [1]=&#039;&amp;lt;local name&amp;gt;&#039; etc.&lt;br /&gt;
	[&#039;inv_local_season&#039;] = {},													-- used in date translation; copy of date_names[&#039;local&#039;].season where k/v are inverted: [1]=&#039;&amp;lt;local name&amp;gt;&#039; etc.&lt;br /&gt;
	[&#039;inv_local_named&#039;] = {},													-- used in date translation; copy of date_names[&#039;local&#039;].named where k/v are inverted: [1]=&#039;&amp;lt;local name&amp;gt;&#039; etc.&lt;br /&gt;
	[&#039;local_digits&#039;] = {[&#039;0&#039;] = &#039;0&#039;, [&#039;1&#039;] = &#039;1&#039;, [&#039;2&#039;] = &#039;2&#039;, [&#039;3&#039;] = &#039;3&#039;, [&#039;4&#039;] = &#039;4&#039;, [&#039;5&#039;] = &#039;5&#039;, [&#039;6&#039;] = &#039;6&#039;, [&#039;7&#039;] = &#039;7&#039;, [&#039;8&#039;] = &#039;8&#039;, [&#039;9&#039;] = &#039;9&#039;},	-- used to convert local language digits to Western 0-9&lt;br /&gt;
	[&#039;xlate_digits&#039;] = {},&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
if local_date_names_from_mediawiki then											-- if fetching local month names from MediaWiki is enabled&lt;br /&gt;
	local long_t = {};&lt;br /&gt;
	local short_t = {};&lt;br /&gt;
	for i=1, 12 do																-- loop 12x and &lt;br /&gt;
		local name = lang_obj:formatDate(&#039;F&#039;, &#039;2022-&#039; .. i .. &#039;-1&#039;);			-- get long month name for each i&lt;br /&gt;
		long_t[name] = i;														-- save it&lt;br /&gt;
		name = lang_obj:formatDate(&#039;M&#039;, &#039;2022-&#039; .. i .. &#039;-1&#039;);					-- get short month name for each i&lt;br /&gt;
		short_t[name] = i;														-- save it&lt;br /&gt;
	end&lt;br /&gt;
	date_names[&#039;local&#039;][&#039;long&#039;] = long_t;										-- write the long table – overwrites manual translation&lt;br /&gt;
	date_names[&#039;local&#039;][&#039;short&#039;] = short_t;										-- write the short table – overwrites manual translation&lt;br /&gt;
end&lt;br /&gt;
																				-- create inverted date-name tables for reformatting and/or translation&lt;br /&gt;
for _, invert_t in pairs {{&#039;long&#039;, &#039;inv_local_long&#039;}, {&#039;short&#039;, &#039;inv_local_short&#039;}, {&#039;quarter&#039;, &#039;inv_local_quarter&#039;}, {&#039;season&#039;, &#039;inv_local_season&#039;}, {&#039;named&#039;, &#039;inv_local_named&#039;}} do&lt;br /&gt;
	for name, i in pairs (date_names[&#039;local&#039;][invert_t[1]]) do					-- this table is [&#039;name&#039;] = i&lt;br /&gt;
		date_names[invert_t[2]][i] = name;										-- invert to get [i] = &#039;name&#039; for conversions from ymd&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if local_digits_from_mediawiki then												-- if fetching local digits from MediaWiki is enabled&lt;br /&gt;
	local digits_t = {};&lt;br /&gt;
	for i=0, 9 do																-- loop 10x and &lt;br /&gt;
		digits_t [lang_obj:formatNum (i)] = tostring (i);						-- format the loop indexer as local lang table index and assign loop indexer (a string) as the value&lt;br /&gt;
	end&lt;br /&gt;
	date_names[&#039;local_digits&#039;] = digits_t;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for ld, ed in pairs (date_names.local_digits) do								-- make a digit translation table for simple date translation from en to local language using local_digits table&lt;br /&gt;
	date_names.xlate_digits [ed] = ld;											-- en digit becomes index with local digit as the value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local df_template_patterns = {													-- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}&lt;br /&gt;
	&#039;{{ *[Uu]se +(dmy) +dates *[|}]&#039;,	-- 1159k								-- sorted by approximate transclusion count&lt;br /&gt;
	&#039;{{ *[Uu]se +(mdy) +dates *[|}]&#039;,	-- 212k&lt;br /&gt;
	&#039;{{ *[Uu]se +(MDY) +dates *[|}]&#039;,	-- 788&lt;br /&gt;
	&#039;{{ *[Uu]se +(DMY) +dates *[|}]&#039;,	-- 343&lt;br /&gt;
	&#039;{{ *([Mm]dy) *[|}]&#039;,				-- 176&lt;br /&gt;
	&#039;{{ *[Uu]se *(dmy) *[|}]&#039;,			-- 156 + 18&lt;br /&gt;
	&#039;{{ *[Uu]se *(mdy) *[|}]&#039;,			-- 149 + 11&lt;br /&gt;
	&#039;{{ *([Dd]my) *[|}]&#039;,				-- 56&lt;br /&gt;
	&#039;{{ *[Uu]se +(MDY) *[|}]&#039;,			-- 5&lt;br /&gt;
	&#039;{{ *([Dd]MY) *[|}]&#039;,				-- 3&lt;br /&gt;
	&#039;{{ *[Uu]se(mdy)dates *[|}]&#039;,		-- 1&lt;br /&gt;
	&#039;{{ *[Uu]se +(DMY) *[|}]&#039;,			-- 0&lt;br /&gt;
	&#039;{{ *([Mm]DY) *[|}]&#039;,				-- 0&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
local title_object = mw.title.getCurrentTitle();&lt;br /&gt;
local content;																	-- done this way  so that unused templates appear in unused-template-reports; self-transcluded makes them look like they are used&lt;br /&gt;
if 10 ~= title_object.namespace then											-- all namespaces except Template&lt;br /&gt;
	content = title_object:getContent() or &#039;&#039;;									-- get the content of the article or &#039;&#039;; new pages edited w/ve do not have &#039;content&#039; until saved; ve does not preview; phab:T221625&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_date_format ()&lt;br /&gt;
	if not content then															-- nil content when we&#039;re in template&lt;br /&gt;
		return nil;																-- auto-formatting does not work in Template space so don&#039;t set global_df&lt;br /&gt;
	end&lt;br /&gt;
	for _, pattern in ipairs (df_template_patterns) do							-- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects&lt;br /&gt;
		local start, _, match = content:find(pattern);							-- match is the three letters indicating desired date format&lt;br /&gt;
		if match then&lt;br /&gt;
			local use_dates_template = content:match (&#039;%b{}&#039;, start);			-- get the whole template&lt;br /&gt;
			if use_dates_template:match (&#039;| *cs1%-dates *= *[lsy][sy]?&#039;) then	-- look for |cs1-dates=publication date length access-/archive-date length&lt;br /&gt;
				return match:lower() .. &#039;-&#039; .. use_dates_template:match (&#039;| *cs1%-dates *= *([lsy][sy]?)&#039;);&lt;br /&gt;
			else&lt;br /&gt;
				return match:lower() .. &#039;-all&#039;;									-- no |cs1-dates= k/v pair; return value appropriate for use in |df=&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local global_df;																-- TODO: add this to &amp;lt;global_cs1_config_t&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-----------------&amp;lt; V O L U M E ,  I S S U E ,  P A G E S &amp;gt;------------------&lt;br /&gt;
&lt;br /&gt;
These tables hold cite class values (from the template invocation) and identify those templates that support&lt;br /&gt;
|volume=, |issue=, and |page(s)= parameters.  Cite conference and cite map require further qualification which&lt;br /&gt;
is handled in the main module.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local templates_using_volume = {&#039;citation&#039;, &#039;audio-visual&#039;, &#039;book&#039;, &#039;conference&#039;, &#039;encyclopaedia&#039;, &#039;interview&#039;, &#039;journal&#039;, &#039;magazine&#039;, &#039;map&#039;, &#039;news&#039;, &#039;report&#039;, &#039;techreport&#039;, &#039;thesis&#039;}&lt;br /&gt;
local templates_using_issue = {&#039;citation&#039;, &#039;conference&#039;, &#039;episode&#039;, &#039;interview&#039;, &#039;journal&#039;, &#039;magazine&#039;, &#039;map&#039;, &#039;news&#039;, &#039;podcast&#039;}&lt;br /&gt;
local templates_not_using_page = {&#039;audio-visual&#039;, &#039;episode&#039;, &#039;mailinglist&#039;, &#039;newsgroup&#039;, &#039;podcast&#039;, &#039;serial&#039;, &#039;sign&#039;, &#039;speech&#039;}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
&lt;br /&gt;
These tables control when it is appropriate for {{citation}} to render |volume= and/or |issue=.  The parameter&lt;br /&gt;
names in the tables constrain {{citation}} so that its renderings match the renderings of the equivalent cs1&lt;br /&gt;
templates.  For example, {{cite web}} does not support |volume= so the equivalent {{citation |website=...}} must&lt;br /&gt;
not support |volume=.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local citation_no_volume_t = {													-- {{citation}} does not render |volume= when these parameters are used&lt;br /&gt;
	&#039;website&#039;, &#039;mailinglist&#039;, &#039;script-website&#039;,&lt;br /&gt;
	}&lt;br /&gt;
local citation_issue_t = {														-- {{citation}} may render |issue= when these parameters are used&lt;br /&gt;
	&#039;journal&#039;, &#039;magazine&#039;, &#039;newspaper&#039;, &#039;periodical&#039;, &#039;work&#039;,&lt;br /&gt;
	&#039;script-journal&#039;, &#039;script-magazine&#039;, &#039;script-newspaper&#039;, &#039;script-periodical&#039;, &#039;script-work&#039;,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
&lt;br /&gt;
Patterns for finding extra text in |volume=, |issue=, |page=, |pages=&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local vol_iss_pg_patterns = {&lt;br /&gt;
	good_ppattern = &#039;^P[^%.PpGg]&#039;,												-- OK to begin with uppercase P: P7 (page 7 of section P), but not p123 (page 123); TODO: this allows &#039;Pages&#039; which it should not&lt;br /&gt;
	bad_ppatterns = {															-- patterns for |page= and |pages=&lt;br /&gt;
		&#039;^[Pp][PpGg]?%.?[ %d]&#039;,&lt;br /&gt;
		&#039;^[Pp][Pp]?%.&amp;amp;nbsp;&#039;,													-- from {{p.}} and {{pp.}} templates&lt;br /&gt;
		&#039;^[Pp]ages?&#039;,&lt;br /&gt;
		&#039;^[Pp]gs.?&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	vi_patterns_t = {															-- combined to catch volume-like text in |issue= and issue-like text in |volume=&lt;br /&gt;
		&#039;^volumes?&#039;,															-- volume-like text&lt;br /&gt;
		&#039;^vols?[%.:=]?&#039;,&lt;br /&gt;
&lt;br /&gt;
		&#039;^issues?&#039;,																--issue-like text&lt;br /&gt;
		&#039;^iss[%.:=]?&#039;,&lt;br /&gt;
		&#039;^numbers?&#039;,&lt;br /&gt;
		&#039;^nos?%A&#039;,																-- don&#039;t match &#039;november&#039; or &#039;nostradamus&#039;&lt;br /&gt;
		&#039;^nr[%.:=]?&#039;,&lt;br /&gt;
		&#039;^n[%.:= ]&#039;,															-- might be a valid issue without separator (space char is sep char here)&lt;br /&gt;
		&#039;^n°&#039;,																	-- &#039;n&#039; with degree sign (U+00B0)&lt;br /&gt;
		&#039;^№&#039;,																	-- precomposed unicode numero character (U+2116)&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; K E Y W O R D S &amp;gt;-------------------------------&lt;br /&gt;
&lt;br /&gt;
These tables hold keywords for those parameters that have defined sets of acceptable keywords.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
--[[-------------------&amp;lt; K E Y W O R D S   T A B L E &amp;gt;--------------------------&lt;br /&gt;
&lt;br /&gt;
this is a list of keywords; each key in the list is associated with a table of&lt;br /&gt;
synonymous keywords possibly from different languages.&lt;br /&gt;
&lt;br /&gt;
for I18N: add local-language keywords to value table; do not change the key.&lt;br /&gt;
For example, adding the German keyword &#039;ja&#039;:&lt;br /&gt;
	[&#039;affirmative&#039;] = {&#039;yes&#039;, &#039;true&#039;, &#039;y&#039;, &#039;ja&#039;},&lt;br /&gt;
&lt;br /&gt;
Because CS1|2 templates from en.wiki articles are often copied to other local wikis,&lt;br /&gt;
it is recommended that the English keywords remain in these tables.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local keywords = {&lt;br /&gt;
	[&#039;amp&#039;] = {&#039;&amp;amp;&#039;, &#039;amp&#039;, &#039;ampersand&#039;}, 										-- |name-list-style=&lt;br /&gt;
	[&#039;and&#039;] = {&#039;and&#039;, &#039;serial&#039;},												-- |name-list-style=&lt;br /&gt;
	[&#039;affirmative&#039;] = {&#039;yes&#039;, &#039;true&#039;, &#039;y&#039;},										-- |no-tracking=, |no-pp= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;afterword&#039;] = {&#039;afterword&#039;},												-- |contribution=&lt;br /&gt;
	[&#039;bot: unknown&#039;] = {&#039;bot: unknown&#039;},										-- |url-status= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;cs1&#039;] = {&#039;cs1&#039;},															-- |mode=&lt;br /&gt;
	[&#039;cs2&#039;] = {&#039;cs2&#039;},															-- |mode=&lt;br /&gt;
	[&#039;dead&#039;] = {&#039;dead&#039;, &#039;deviated&#039;},											-- |url-status= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;dmy&#039;] = {&#039;dmy&#039;},															-- |df=&lt;br /&gt;
	[&#039;dmy-all&#039;] = {&#039;dmy-all&#039;},													-- |df=&lt;br /&gt;
	[&#039;foreword&#039;] = {&#039;foreword&#039;},												-- |contribution=&lt;br /&gt;
	[&#039;free&#039;] = {&#039;free&#039;},														-- |&amp;lt;id&amp;gt;-access= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;harv&#039;] = {&#039;harv&#039;},														-- |ref=; this no longer supported; is_valid_parameter_value() called with &amp;lt;invert&amp;gt; = true&lt;br /&gt;
	[&#039;introduction&#039;] = {&#039;introduction&#039;},										-- |contribution=&lt;br /&gt;
	[&#039;limited&#039;] = {&#039;limited&#039;},													-- |url-access= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;live&#039;] = {&#039;live&#039;},														-- |url-status= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;mdy&#039;] = {&#039;mdy&#039;},															-- |df=&lt;br /&gt;
	[&#039;mdy-all&#039;] = {&#039;mdy-all&#039;},													-- |df=&lt;br /&gt;
	[&#039;none&#039;] = {&#039;none&#039;},														-- |postscript=, |ref=, |title=, |type= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;off&#039;] = {&#039;off&#039;},															-- |title= (potentially also: |title-link=, |postscript=, |ref=, |type=)&lt;br /&gt;
	[&#039;preface&#039;] = {&#039;preface&#039;},													-- |contribution=&lt;br /&gt;
	[&#039;registration&#039;] = {&#039;registration&#039;},										-- |url-access= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;subscription&#039;] = {&#039;subscription&#039;},										-- |url-access= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;unfit&#039;] = {&#039;unfit&#039;},														-- |url-status= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;usurped&#039;] = {&#039;usurped&#039;},													-- |url-status= -- Used by InternetArchiveBot&lt;br /&gt;
	[&#039;vanc&#039;] = {&#039;vanc&#039;},														-- |name-list-style=&lt;br /&gt;
	[&#039;ymd&#039;] = {&#039;ymd&#039;},															-- |df=&lt;br /&gt;
	[&#039;ymd-all&#039;] = {&#039;ymd-all&#039;},													-- |df=&lt;br /&gt;
	--	[&#039;yMd&#039;] = {&#039;yMd&#039;},														-- |df=; not supported at en.wiki&lt;br /&gt;
	--	[&#039;yMd-all&#039;] = {&#039;yMd-all&#039;},												-- |df=; not supported at en.wiki&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[------------------------&amp;lt; X L A T E _ K E Y W O R D S &amp;gt;---------------------&lt;br /&gt;
&lt;br /&gt;
this function builds a list, keywords_xlate{}, of the keywords found in keywords{} where the values from keywords{}&lt;br /&gt;
become the keys in keywords_xlate{} and the keys from keywords{} become the values in keywords_xlate{}:&lt;br /&gt;
	[&#039;affirmative&#039;] = {&#039;yes&#039;, &#039;true&#039;, &#039;y&#039;},		-- in keywords{}&lt;br /&gt;
becomes&lt;br /&gt;
	[&#039;yes&#039;] = &#039;affirmative&#039;,					-- in keywords_xlate{}&lt;br /&gt;
	[&#039;true&#039;] = &#039;affirmative&#039;,&lt;br /&gt;
	[&#039;y&#039;] = &#039;affirmative&#039;,&lt;br /&gt;
&lt;br /&gt;
the purpose of this function is to act as a translator between a non-English keyword and its English equivalent&lt;br /&gt;
that may be used in other modules of this suite&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function xlate_keywords ()&lt;br /&gt;
	local out_table = {};														-- output goes here&lt;br /&gt;
	for k, keywords_t in pairs (keywords) do									-- spin through the keywords table&lt;br /&gt;
		for _, keyword in ipairs (keywords_t) do								-- for each keyword&lt;br /&gt;
			out_table[keyword] = k;												-- create an entry in the output table where keyword is the key&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return out_table;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local keywords_xlate = xlate_keywords ();										-- the list of translated keywords&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------&amp;lt; M A K E _ K E Y W O R D S _ L I S T &amp;gt;---------------------&lt;br /&gt;
&lt;br /&gt;
this function assembles, for parameter-value validation, the list of keywords appropriate to that parameter.&lt;br /&gt;
&lt;br /&gt;
keywords_lists{}, is a table of tables from keywords{}&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function make_keywords_list (keywords_lists)&lt;br /&gt;
	local out_table = {};														-- output goes here&lt;br /&gt;
	&lt;br /&gt;
	for _, keyword_list in ipairs (keywords_lists) do							-- spin through keywords_lists{} and get a table of keywords&lt;br /&gt;
		for _, keyword in ipairs (keyword_list) do								-- spin through keyword_list{} and add each keyword, ...&lt;br /&gt;
			table.insert (out_table, keyword);									-- ... as plain text, to the output list&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return out_table;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------&amp;lt; K E Y W O R D S _ L I S T S &amp;gt;-----------------------------&lt;br /&gt;
&lt;br /&gt;
this is a list of lists of valid keywords for the various parameters in [key].&lt;br /&gt;
Generally the keys in this table are the canonical en.wiki parameter names though&lt;br /&gt;
some are contrived because of use in multiple differently named parameters:&lt;br /&gt;
[&#039;yes_true_y&#039;], [&#039;id-access&#039;].&lt;br /&gt;
&lt;br /&gt;
The function make_keywords_list() extracts the individual keywords from the&lt;br /&gt;
appropriate list in keywords{}.&lt;br /&gt;
&lt;br /&gt;
The lists in this table are used to validate the keyword assignment for the&lt;br /&gt;
parameters named in this table&#039;s keys.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local keywords_lists = {&lt;br /&gt;
	[&#039;yes_true_y&#039;] = make_keywords_list ({keywords.affirmative}),&lt;br /&gt;
	[&#039;contribution&#039;] = make_keywords_list ({keywords.afterword, keywords.foreword, keywords.introduction, keywords.preface}),&lt;br /&gt;
	[&#039;df&#039;] = make_keywords_list ({keywords.dmy, keywords[&#039;dmy-all&#039;], keywords.mdy, keywords[&#039;mdy-all&#039;], keywords.ymd, keywords[&#039;ymd-all&#039;]}),&lt;br /&gt;
	--	[&#039;df&#039;] = make_keywords_list ({keywords.dmy, keywords[&#039;dmy-all&#039;], keywords.mdy, keywords[&#039;mdy-all&#039;], keywords.ymd, keywords[&#039;ymd-all&#039;], keywords.yMd, keywords[&#039;yMd-all&#039;]}),	-- not supported at en.wiki&lt;br /&gt;
	[&#039;mode&#039;] = make_keywords_list ({keywords.cs1, keywords.cs2}),&lt;br /&gt;
	[&#039;name-list-style&#039;] = make_keywords_list ({keywords.amp, keywords[&#039;and&#039;], keywords.vanc}),&lt;br /&gt;
	[&#039;ref&#039;] = make_keywords_list ({keywords.harv}),								-- inverted check; |ref=harv no longer supported&lt;br /&gt;
	[&#039;url-access&#039;] = make_keywords_list ({keywords.subscription, keywords.limited, keywords.registration}),&lt;br /&gt;
	[&#039;url-status&#039;] = make_keywords_list ({keywords.dead, keywords.live, keywords.unfit, keywords.usurped, keywords[&#039;bot: unknown&#039;]}),&lt;br /&gt;
	[&#039;id-access&#039;] = make_keywords_list ({keywords.free}),&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C S 1 _ C O N F I G _ G E T &amp;gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
fetch and validate values from {{cs1 config}} template to fill &amp;lt;global_cs1_config_t&amp;gt;&lt;br /&gt;
&lt;br /&gt;
no error messages; when errors are detected, the parameter value from {{cs1 config}} is blanked.&lt;br /&gt;
&lt;br /&gt;
Supports all parameters and aliases associated with the metaparameters: DisplayAuthors, DisplayContributors,&lt;br /&gt;
DisplayEditors, DisplayInterviewers, DisplayTranslators, NameListStyle, and Mode.  The DisplayWhatever metaparameters&lt;br /&gt;
accept numeric values only (|display-authors=etal and the like is not supported).&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local global_cs1_config_t = {};													-- TODO: add value returned from get_date_format() to this table?&lt;br /&gt;
&lt;br /&gt;
local function get_cs1_config ()&lt;br /&gt;
	if not content then															-- nil content when we&#039;re in template&lt;br /&gt;
		return nil;																-- auto-formatting does not work in Template space so don&#039;t set global_df&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local start = content:find(&#039;{{ *[Cc][Ss]1 config *[|}]&#039;);					-- &amp;lt;start&amp;gt; is offset into &amp;lt;content&amp;gt; when {{cs1 config}} found; nil else&lt;br /&gt;
	if start then&lt;br /&gt;
		local cs1_config_template = content:match (&#039;%b{}&#039;, start);				-- get the whole template&lt;br /&gt;
&lt;br /&gt;
		if not cs1_config_template then&lt;br /&gt;
			return nil;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local params_t = mw.text.split (cs1_config_template:gsub (&#039;^{{%s*&#039;, &#039;&#039;):gsub (&#039;%s*}}$&#039;, &#039;&#039;), &#039;%s*|%s*&#039;);	-- remove &#039;{{&#039; and &#039;}}&#039;; make a sequence of parameter/value pairs (split on the pipe)&lt;br /&gt;
		table.remove (params_t, 1);												-- remove the template name because it isn&#039;t a parameter/value pair&lt;br /&gt;
&lt;br /&gt;
		local config_meta_params_t = {&#039;DisplayAuthors&#039;, &#039;DisplayContributors&#039;, &#039;DisplayEditors&#039;, &#039;DisplayInterviewers&#039;, &#039;DisplayTranslators&#039;, &#039;NameListStyle&#039;, &#039;Mode&#039;};&lt;br /&gt;
		local meta_param_map_t = {};											-- list of accepted parameter names usable in {{cs1 config}} goes here&lt;br /&gt;
		&lt;br /&gt;
		for _, meta_param in ipairs (config_meta_params_t) do					-- for i18n using &amp;lt;config_meta_params_t&amp;gt;, map template parameter names to their metaparameter equivalents&lt;br /&gt;
			if &#039;table&#039; == type (aliases[meta_param]) then						-- if &amp;lt;meta_param&amp;gt; is a sequence, &lt;br /&gt;
				for _, param in ipairs (aliases[meta_param]) do					-- extract its contents&lt;br /&gt;
					meta_param_map_t[param] = meta_param;						-- and add to &amp;lt;meta_param_map_t&amp;gt;&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				meta_param_map_t[aliases[meta_param]] = meta_param;				-- not a sequence so just add the parameter to &amp;lt;meta_param_map_t&amp;gt;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local keywords_t = {};													-- map valid keywords to their associate metaparameter; reverse form of &amp;lt;keyword_lists[key] for these metaparameters&lt;br /&gt;
		for _, metaparam_t in ipairs ({{&#039;NameListStyle&#039;, &#039;name-list-style&#039;}, {&#039;Mode&#039;, &#039;mode&#039;}}) do	-- only these metaparameter / keywords_lists key pairs&lt;br /&gt;
			for _, keyword in ipairs (keywords_lists[metaparam_t[2]]) do		-- spin through the list of keywords&lt;br /&gt;
				keywords_t[keyword] = metaparam_t[1];							-- add [keyword] = metaparameter to the map&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		for _, param in ipairs (params_t) do									-- spin through the {{cs1 config}} parameters and fill &amp;lt;global_cs1_config_t&amp;gt;&lt;br /&gt;
			local k, v = param:match (&#039;([^=]-)%s*=%s*(.+)&#039;);					-- &amp;lt;k&amp;gt; is the parameter name; &amp;lt;v&amp;gt; is parameter&#039;s assigned value&lt;br /&gt;
			if k then&lt;br /&gt;
				if k:find (&#039;^display&#039;) then										-- if &amp;lt;k&amp;gt; is one of the |display-&amp;lt;namelist&amp;gt;= parameters&lt;br /&gt;
					if v:match (&#039;%d+&#039;) then										-- the assigned value must be digits; doesn&#039;t accept &#039;etal&#039;&lt;br /&gt;
						global_cs1_config_t[meta_param_map_t[k]]=v;				-- add the display param and its value to globals table&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					if keywords_t[v] == meta_param_map_t[k] then				-- keywords_t[v] returns nil or the metaparam name; these must be the same&lt;br /&gt;
						global_cs1_config_t[meta_param_map_t[k]]=v;				-- add the parameter and its value to globals table&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
get_cs1_config ();																-- fill &amp;lt;global_cs1_config_t&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[---------------------&amp;lt; S T R I P M A R K E R S &amp;gt;----------------------------&lt;br /&gt;
&lt;br /&gt;
Common pattern definition location for stripmarkers so that we don&#039;t have to go&lt;br /&gt;
hunting for them if (when) MediaWiki changes their form.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local stripmarkers = {&lt;br /&gt;
	[&#039;any&#039;] = &#039;\127[^\127]*UNIQ%-%-(%a+)%-[%a%d]+%-QINU[^\127]*\127&#039;,			-- capture returns name of stripmarker&lt;br /&gt;
	[&#039;math&#039;] = &#039;\127[^\127]*UNIQ%-%-math%-[%a%d]+%-QINU[^\127]*\127&#039;			-- math stripmarkers used in coins_cleanup() and coins_replace_math_stripmarker()&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[------------&amp;lt; I N V I S I B L E _ C H A R A C T E R S &amp;gt;---------------------&lt;br /&gt;
&lt;br /&gt;
This table holds non-printing or invisible characters indexed either by name or&lt;br /&gt;
by Unicode group. Values are decimal representations of UTF-8 codes.  The table&lt;br /&gt;
is organized as a table of tables because the Lua pairs keyword returns table&lt;br /&gt;
data in an arbitrary order.  Here, we want to process the table from top to bottom&lt;br /&gt;
because the entries at the top of the table are also found in the ranges specified&lt;br /&gt;
by the entries at the bottom of the table.&lt;br /&gt;
&lt;br /&gt;
Also here is a pattern that recognizes stripmarkers that begin and end with the&lt;br /&gt;
delete characters.  The nowiki stripmarker is not an error but some others are&lt;br /&gt;
because the parameter values that include them become part of the template&#039;s&lt;br /&gt;
metadata before stripmarker replacement.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local invisible_defs = {&lt;br /&gt;
	del = &#039;\127&#039;,																-- used to distinguish between stripmarker and del char&lt;br /&gt;
	zwj = &#039;\226\128\141&#039;,														-- used with capture because zwj may be allowed&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
local invisible_chars = {&lt;br /&gt;
	{&#039;replacement&#039;, &#039;\239\191\189&#039;},											-- U+FFFD, EF BF BD&lt;br /&gt;
	{&#039;zero width joiner&#039;, &#039;(&#039;.. invisible_defs.zwj .. &#039;)&#039;},						-- U+200D, E2 80 8D; capture because zwj may be allowed&lt;br /&gt;
	{&#039;zero width space&#039;, &#039;\226\128\139&#039;},										-- U+200B, E2 80 8B&lt;br /&gt;
	{&#039;hair space&#039;, &#039;\226\128\138&#039;},												-- U+200A, E2 80 8A&lt;br /&gt;
	{&#039;soft hyphen&#039;, &#039;\194\173&#039;},												-- U+00AD, C2 AD&lt;br /&gt;
	{&#039;horizontal tab&#039;, &#039;\009&#039;},													-- U+0009 (HT), 09&lt;br /&gt;
	{&#039;line feed&#039;, &#039;\010&#039;},														-- U+000A (LF), 0A&lt;br /&gt;
	{&#039;no-break space&#039;, &#039;\194\160&#039;},												-- U+00A0 (NBSP), C2 A0&lt;br /&gt;
	{&#039;carriage return&#039;, &#039;\013&#039;},												-- U+000D (CR), 0D&lt;br /&gt;
	{&#039;stripmarker&#039;, stripmarkers.any},											-- stripmarker; may or may not be an error; capture returns the stripmaker type&lt;br /&gt;
	{&#039;delete&#039;, &#039;(&#039;.. invisible_defs.del .. &#039;)&#039;},								-- U+007F (DEL), 7F; must be done after stripmarker test; capture to distinguish isolated del chars not part of stripmarker&lt;br /&gt;
	{&#039;C0 control&#039;, &#039;[\000-\008\011\012\014-\031]&#039;},								-- U+0000–U+001F (NULL–US), 00–1F (except HT, LF, CR (09, 0A, 0D))&lt;br /&gt;
	{&#039;C1 control&#039;, &#039;[\194\128-\194\159]&#039;},										-- U+0080–U+009F (XXX–APC), C2 80 – C2 9F&lt;br /&gt;
	--	{&#039;Specials&#039;, &#039;[\239\191\185-\239\191\191]&#039;},								-- U+FFF9-U+FFFF, EF BF B9 – EF BF BF&lt;br /&gt;
	--	{&#039;Private use area&#039;, &#039;[\238\128\128-\239\163\191]&#039;},						-- U+E000–U+F8FF, EE 80 80 – EF A3 BF&lt;br /&gt;
	--	{&#039;Supplementary Private Use Area-A&#039;, &#039;[\243\176\128\128-\243\191\191\189]&#039;},	-- U+F0000–U+FFFFD, F3 B0 80 80 – F3 BF BF BD&lt;br /&gt;
	--	{&#039;Supplementary Private Use Area-B&#039;, &#039;[\244\128\128\128-\244\143\191\189]&#039;},	-- U+100000–U+10FFFD, F4 80 80 80 – F4 8F BF BD&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
&lt;br /&gt;
Indic script makes use of zero width joiner as a character modifier so zwj&lt;br /&gt;
characters must be left in.  This pattern covers all of the unicode characters&lt;br /&gt;
for these languages:&lt;br /&gt;
	Devanagari					0900–097F – https://unicode.org/charts/PDF/U0900.pdf&lt;br /&gt;
		Devanagari extended		A8E0–A8FF – https://unicode.org/charts/PDF/UA8E0.pdf&lt;br /&gt;
	Bengali						0980–09FF – https://unicode.org/charts/PDF/U0980.pdf&lt;br /&gt;
	Gurmukhi					0A00–0A7F – https://unicode.org/charts/PDF/U0A00.pdf&lt;br /&gt;
	Gujarati					0A80–0AFF – https://unicode.org/charts/PDF/U0A80.pdf&lt;br /&gt;
	Oriya						0B00–0B7F – https://unicode.org/charts/PDF/U0B00.pdf&lt;br /&gt;
	Tamil						0B80–0BFF – https://unicode.org/charts/PDF/U0B80.pdf&lt;br /&gt;
	Telugu						0C00–0C7F – https://unicode.org/charts/PDF/U0C00.pdf&lt;br /&gt;
	Kannada						0C80–0CFF – https://unicode.org/charts/PDF/U0C80.pdf&lt;br /&gt;
	Malayalam					0D00–0D7F – https://unicode.org/charts/PDF/U0D00.pdf&lt;br /&gt;
plus the not-necessarily Indic scripts for Sinhala and Burmese:&lt;br /&gt;
	Sinhala						0D80-0DFF - https://unicode.org/charts/PDF/U0D80.pdf&lt;br /&gt;
	Myanmar						1000-109F - https://unicode.org/charts/PDF/U1000.pdf&lt;br /&gt;
		Myanmar extended A		AA60-AA7F - https://unicode.org/charts/PDF/UAA60.pdf&lt;br /&gt;
		Myanmar extended B		A9E0-A9FF - https://unicode.org/charts/PDF/UA9E0.pdf&lt;br /&gt;
the pattern is used by has_invisible_chars() and coins_cleanup()&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local indic_script = &#039;[\224\164\128-\224\181\191\224\163\160-\224\183\191\225\128\128-\225\130\159\234\167\160-\234\167\191\234\169\160-\234\169\191]&#039;;&lt;br /&gt;
&lt;br /&gt;
-- list of emoji that use a zwj character (U+200D) to combine with another emoji&lt;br /&gt;
-- from: https://unicode.org/Public/emoji/17.0/emoji-zwj-sequences.txt; version: 17.0; 2025-01-08&lt;br /&gt;
-- table created by: [[:en:Module:Make emoji zwj table]]&lt;br /&gt;
local emoji_t = {																-- indexes are decimal forms of the hex values in U+xxxx&lt;br /&gt;
	[8596] = true,																-- U+2194 ↔ left right arrow&lt;br /&gt;
	[8597] = true,																-- U+2195 ↕ up down arrow&lt;br /&gt;
	[9760] = true,																-- U+2620 ☠ skull and crossbones&lt;br /&gt;
	[9792] = true,																-- U+2640 ♀ female sign&lt;br /&gt;
	[9794] = true,																-- U+2642 ♂ male sign&lt;br /&gt;
	[9877] = true,																-- U+2695 ⚕ staff of aesculapius&lt;br /&gt;
	[9878] = true,																-- U+2696 ⚖ scales&lt;br /&gt;
	[9895] = true,																-- U+26A7 ⚧ male with stroke and male and female sign&lt;br /&gt;
	[9992] = true,																-- U+2708 ✈ airplane&lt;br /&gt;
	[10052] = true,																-- U+2744 ❄ snowflake&lt;br /&gt;
	[10084] = true,																-- U+2764 ❤ heavy black heart&lt;br /&gt;
	[10145] = true,																-- U+27A1 ➡ black rightwards arrow&lt;br /&gt;
	[11035] = true,																-- U+2B1B ⬛ black large square&lt;br /&gt;
	[127752] = true,															-- U+1F308 🌈 rainbow&lt;br /&gt;
	[127787] = true,															-- U+1F32B 🌫 fog&lt;br /&gt;
	[127806] = true,															-- U+1F33E 🌾 ear of rice&lt;br /&gt;
	[127859] = true,															-- U+1F373 🍳 cooking&lt;br /&gt;
	[127868] = true,															-- U+1F37C 🍼 baby bottle&lt;br /&gt;
	[127876] = true,															-- U+1F384 🎄 christmas tree&lt;br /&gt;
	[127891] = true,															-- U+1F393 🎓 graduation cap&lt;br /&gt;
	[127908] = true,															-- U+1F3A4 🎤 microphone&lt;br /&gt;
	[127912] = true,															-- U+1F3A8 🎨 artist palette&lt;br /&gt;
	[127979] = true,															-- U+1F3EB 🏫 school&lt;br /&gt;
	[127981] = true,															-- U+1F3ED 🏭 factory&lt;br /&gt;
	[128048] = true,															-- U+1F430 🐰 rabbit face&lt;br /&gt;
	[128102] = true,															-- U+1F466 👦 boy&lt;br /&gt;
	[128103] = true,															-- U+1F467 👧 girl&lt;br /&gt;
	[128104] = true,															-- U+1F468 👨 man&lt;br /&gt;
	[128105] = true,															-- U+1F469 👩 woman&lt;br /&gt;
	[128139] = true,															-- U+1F48B 💋 kiss mark&lt;br /&gt;
	[128165] = true,															-- U+1F4A5 💥 collision symbol&lt;br /&gt;
	[128168] = true,															-- U+1F4A8 💨 dash symbol&lt;br /&gt;
	[128171] = true,															-- U+1F4AB 💫 dizzy symbol&lt;br /&gt;
	[128187] = true,															-- U+1F4BB 💻 personal computer&lt;br /&gt;
	[128188] = true,															-- U+1F4BC 💼 brief case&lt;br /&gt;
	[128293] = true,															-- U+1F525 🔥 fire&lt;br /&gt;
	[128295] = true,															-- U+1F527 🔧 wrench&lt;br /&gt;
	[128300] = true,															-- U+1F52C 🔬 microscope&lt;br /&gt;
	[128488] = true,															-- U+1F5E8 🗨 left speech bubble&lt;br /&gt;
	[128640] = true,															-- U+1F680 🚀 rocket&lt;br /&gt;
	[128658] = true,															-- U+1F692 🚒 fire engine&lt;br /&gt;
	[129001] = true,															-- U+1F7E9 🟩 large green square&lt;br /&gt;
	[129003] = true,															-- U+1F7EB 🟫 large brown square&lt;br /&gt;
	[129309] = true,															-- U+1F91D 🤝 handshake&lt;br /&gt;
	[129455] = true,															-- U+1F9AF 🦯 probing cane&lt;br /&gt;
	[129456] = true,															-- U+1F9B0 🦰 emoji component red hair&lt;br /&gt;
	[129457] = true,															-- U+1F9B1 🦱 emoji component curly hair&lt;br /&gt;
	[129458] = true,															-- U+1F9B2 🦲 emoji component bald&lt;br /&gt;
	[129459] = true,															-- U+1F9B3 🦳 emoji component white hair&lt;br /&gt;
	[129466] = true,															-- U+1F9BA 🦺 safety vest&lt;br /&gt;
	[129468] = true,															-- U+1F9BC 🦼 motorized wheelchair&lt;br /&gt;
	[129469] = true,															-- U+1F9BD 🦽 manual wheelchair&lt;br /&gt;
	[129489] = true,															-- U+1F9D1 🧑 adult&lt;br /&gt;
	[129490] = true,															-- U+1F9D2 🧒 child&lt;br /&gt;
	[129648] = true,															-- U+1FA70 🩰 ballet shoes&lt;br /&gt;
	[129657] = true,															-- U+1FA79 🩹 adhesive bandage&lt;br /&gt;
	[129775] = true,															-- U+1FAEF 🫯 fight cloud&lt;br /&gt;
	[129778] = true,															-- U+1FAF2 🫲 leftwards hand&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------------&amp;lt; L A N G U A G E   S U P P O R T &amp;gt;-------------------&lt;br /&gt;
&lt;br /&gt;
These tables and constants support various language-specific functionality.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
--local this_wiki_code = mw.getContentLanguage():getCode();						-- get this wiki&#039;s language code&lt;br /&gt;
local this_wiki_code = lang_obj:getCode();										-- get this wiki&#039;s language code&lt;br /&gt;
if string.match (mw.site.server, &#039;wikidata&#039;) then&lt;br /&gt;
		this_wiki_code = mw.getCurrentFrame():callParserFunction(&#039;int&#039;, {&#039;lang&#039;}); -- on Wikidata so use interface language setting instead&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
local mw_languages_by_tag_t = mw.language.fetchLanguageNames (this_wiki_code, &#039;all&#039;);	-- get a table of language tag/name pairs known to Wikimedia; used for interwiki tests&lt;br /&gt;
local mw_languages_by_name_t = {};&lt;br /&gt;
	for k, v in pairs (mw_languages_by_tag_t) do								-- build a &#039;reversed&#039; table name/tag language pairs know to MediaWiki; used for |language=&lt;br /&gt;
		v = mw.ustring.lower (v);												-- lowercase for tag fetch; get name&#039;s proper case from mw_languages_by_tag_t[&amp;lt;tag&amp;gt;]&lt;br /&gt;
		if mw_languages_by_name_t[v] then										-- when name already in the table&lt;br /&gt;
			if 2 == #k or 3 == #k then											-- if tag does not have subtags&lt;br /&gt;
				mw_languages_by_name_t[v] = k;									-- prefer the shortest tag for this name&lt;br /&gt;
			end&lt;br /&gt;
		else																	-- here when name not in the table&lt;br /&gt;
			mw_languages_by_name_t[v] = k;										-- so add name and matching tag&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
local inter_wiki_map = {};														-- map of interwiki prefixes that are language-code prefixes&lt;br /&gt;
	for k, v in pairs (mw.site.interwikiMap (&#039;local&#039;)) do						-- spin through the base interwiki map (limited to local)&lt;br /&gt;
		if mw_languages_by_tag_t[v[&amp;quot;prefix&amp;quot;]] then								-- if the prefix matches a known language tag&lt;br /&gt;
			inter_wiki_map[v[&amp;quot;prefix&amp;quot;]] = true;									-- add it to our local map&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------&amp;lt; S C R I P T _ L A N G _ C O D E S &amp;gt;-------------------&lt;br /&gt;
&lt;br /&gt;
This table is used to hold ISO 639-1 two-character and ISO 639-3 three-character&lt;br /&gt;
language codes that apply only to |script-title= and |script-chapter=&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local script_lang_codes = {&lt;br /&gt;
	&#039;ab&#039;, &#039;am&#039;, &#039;ar&#039;, &#039;az&#039;, &#039;be&#039;, &#039;bg&#039;, &#039;bn&#039;, &#039;bo&#039;, &#039;bs&#039;, &#039;ce&#039;, &#039;chr&#039;, &#039;cu&#039;,&lt;br /&gt;
	&#039;dv&#039;, &#039;dz&#039;, &#039;el&#039;, &#039;fa&#039;, &#039;grc&#039;, &#039;gu&#039;, &#039;he&#039;, &#039;hi&#039;, &#039;hy&#039;, &#039;ja&#039;, &#039;ka&#039;, &#039;kk&#039;,&lt;br /&gt;
	&#039;km&#039;, &#039;kn&#039;, &#039;ko&#039;, &#039;ku&#039;, &#039;ky&#039;, &#039;lo&#039;, &#039;mk&#039;, &#039;ml&#039;, &#039;mn&#039;, &#039;mni&#039;, &#039;mr&#039;, &#039;my&#039;,&lt;br /&gt;
	&#039;ne&#039;, &#039;or&#039;, &#039;ota&#039;, &#039;pa&#039;, &#039;ps&#039;, &#039;ru&#039;, &#039;sd&#039;, &#039;si&#039;, &#039;sr&#039;, &#039;syc&#039;, &#039;ta&#039;, &#039;te&#039;,&lt;br /&gt;
	&#039;tg&#039;, &#039;th&#039;, &#039;ti&#039;, &#039;tkr&#039;, &#039;tt&#039;, &#039;ug&#039;, &#039;uk&#039;, &#039;ur&#039;, &#039;uz&#039;, &#039;yi&#039;, &#039;yue&#039;, &#039;zh&#039;,&lt;br /&gt;
	&#039;zgh&#039;&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[---------------&amp;lt; L A N G U A G E   R E M A P P I N G &amp;gt;----------------------&lt;br /&gt;
&lt;br /&gt;
These tables hold language information that is different (correct) from MediaWiki&#039;s definitions&lt;br /&gt;
&lt;br /&gt;
For each [&#039;&amp;lt;tag&amp;gt;&#039;] = &#039;language name&#039; in lang_code_remap{} there must be a matching [&#039;language name&#039;] = {&#039;language name&#039;, &#039;&amp;lt;tag&amp;gt;&#039;} in lang_name_remap{}&lt;br /&gt;
&lt;br /&gt;
lang_tag_remap{}:&lt;br /&gt;
	key is always lowercase ISO 639-1, -2, -3 language tag or a valid lowercase IETF language tag&lt;br /&gt;
	value is properly spelled and capitalized language name associated with &amp;lt;tag&amp;gt;&lt;br /&gt;
	only one language name per &amp;lt;tag&amp;gt;;&lt;br /&gt;
	key/value pair must have matching entry in lang_name_remap{}&lt;br /&gt;
&lt;br /&gt;
lang_name_remap{}:&lt;br /&gt;
	key is always lowercase language name&lt;br /&gt;
	value is a table the holds correctly spelled and capitalized language name [1] and associated tag [2] (tag must match a tag key in lang_tag_remap{})&lt;br /&gt;
	may have multiple keys referring to a common preferred name and tag; For example:&lt;br /&gt;
		[&#039;kolsch&#039;] and [&#039;kölsch&#039;] both refer to &#039;Kölsch&#039; and &#039;ksh&#039;&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local lang_tag_remap = {														-- used for |language= and |script-title= / |script-chapter=&lt;br /&gt;
	[&#039;als&#039;] = &#039;Tosk Albanian&#039;,													-- MediaWiki returns Alemannisch &lt;br /&gt;
	[&#039;bh&#039;] = &#039;Bihari&#039;,															-- MediaWiki uses &#039;bh&#039; as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org&lt;br /&gt;
	[&#039;bla&#039;] = &#039;Blackfoot&#039;,														-- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name&lt;br /&gt;
	[&#039;bn&#039;] = &#039;Bengali&#039;,															-- MediaWiki returns Bangla&lt;br /&gt;
	[&#039;ca-valencia&#039;] = &#039;Valencian&#039;,												-- IETF variant of Catalan&lt;br /&gt;
	[&#039;fkv&#039;] = &#039;Kven&#039;,															-- MediaWiki returns Kvensk&lt;br /&gt;
	[&#039;gsw&#039;] = &#039;Swiss German&#039;,&lt;br /&gt;
	[&#039;ilo&#039;] = &#039;Ilocano&#039;,														-- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name&lt;br /&gt;
	[&#039;ksh&#039;] = &#039;Kölsch&#039;,															-- MediaWiki: Colognian; use IANA/ISO 639 preferred name&lt;br /&gt;
	[&#039;ksh-x-colog&#039;] = &#039;Colognian&#039;,												-- override MediaWiki ksh; no IANA/ISO 639 code for Colognian; IETF private code created at Module:Lang/data&lt;br /&gt;
	[&#039;mis-x-ripuar&#039;] = &#039;Ripuarian&#039;,												-- override MediaWiki ksh; no IANA/ISO 639 code for Ripuarian; IETF private code created at Module:Lang/data&lt;br /&gt;
	[&#039;nan-tw&#039;] = &#039;Taiwanese Hokkien&#039;,											-- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese and support en.wiki preferred name&lt;br /&gt;
	[&#039;sr-ec&#039;] = &#039;Serbian (Cyrillic script)&#039;,									-- MediaWiki returns српски (ћирилица)&lt;br /&gt;
	[&#039;sr-el&#039;] = &#039;Serbian (Latin script)&#039;,										-- MediaWiki returns srpski (latinica)&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
local lang_name_remap = {														-- used for |language=; names require proper capitalization; tags must be lowercase&lt;br /&gt;
	[&#039;alemannic&#039;] = {&#039;Swiss German&#039;, &#039;gsw&#039;},									-- ISO 639-2, -3 alternate for Swiss German; MediaWiki mediawiki returns Alemannic for gsw; en.wiki preferred name&lt;br /&gt;
	[&#039;alemannisch&#039;] = {&#039;Swiss German&#039;, &#039;gsw&#039;},									-- not an ISO or IANA language name; MediaWiki uses &#039;als&#039; as a subdomain name for Alemannic Wikipedia: als.wikipedia.org&lt;br /&gt;
	[&#039;bangla&#039;] = {&#039;Bengali&#039;, &#039;bn&#039;},												-- MediaWiki returns Bangla (the endonym) but we want Bengali (the exonym); here we remap&lt;br /&gt;
	[&#039;bengali&#039;] = {&#039;Bengali&#039;, &#039;bn&#039;},											-- MediaWiki doesn&#039;t use exonym so here we provide correct language name and 639-1 code&lt;br /&gt;
	[&#039;bhojpuri&#039;] = {&#039;Bhojpuri&#039;, &#039;bho&#039;},											-- MediaWiki uses &#039;bh&#039; as a subdomain name for Bhojpuri Wikipedia: bh.wikipedia.org&lt;br /&gt;
	[&#039;bihari&#039;] = {&#039;Bihari&#039;, &#039;bh&#039;},												-- MediaWiki replaces &#039;Bihari&#039; with &#039;Bhojpuri&#039; so &#039;Bihari&#039; cannot be found&lt;br /&gt;
	[&#039;blackfoot&#039;] = {&#039;Blackfoot&#039;, &#039;bla&#039;},										-- MediaWiki/IANA/ISO 639: Siksika; use en.wiki preferred name&lt;br /&gt;
	[&#039;colognian&#039;] = {&#039;Colognian&#039;, &#039;ksh-x-colog&#039;},								-- MediaWiki preferred name for ksh&lt;br /&gt;
	[&#039;ilocano&#039;] = {&#039;Ilocano&#039;, &#039;ilo&#039;},											-- MediaWiki/IANA/ISO 639: Iloko; use en.wiki preferred name&lt;br /&gt;
	[&#039;kolsch&#039;] = {&#039;Kölsch&#039;, &#039;ksh&#039;},												-- use IANA/ISO 639 preferred name (use non-diacritical o instead of umlaut ö)&lt;br /&gt;
	[&#039;kölsch&#039;] = {&#039;Kölsch&#039;, &#039;ksh&#039;},												-- use IANA/ISO 639 preferred name&lt;br /&gt;
	[&#039;kven&#039;] = {&#039;Kven&#039;, &#039;fkv&#039;},													-- Unicode CLDR have decided not to support English language name for these two...&lt;br /&gt;
	[&#039;kvensk&#039;] = {&#039;Kven&#039;, &#039;fkv&#039;},												-- ...they say to refer to IANA registry for English names&lt;br /&gt;
	[&#039;ripuarian&#039;] = {&#039;Ripuarian&#039;, &#039;mis-x-ripuar&#039;},								-- group of dialects; no code in MediaWiki or in IANA/ISO 639&lt;br /&gt;
	[&#039;serbian (cyrillic script)&#039;] = {&#039;Serbian (Cyrillic script)&#039;, &#039;sr-cyrl&#039;},	-- special case to get correct tag when |language=sr-ec&lt;br /&gt;
	[&#039;serbian (latin script)&#039;] = {&#039;Serbian (Latin script)&#039;, &#039;sr-latn&#039;},			-- special case to get correct tag when |language=sr-el&lt;br /&gt;
	[&#039;swiss german&#039;] = {&#039;Swiss German&#039;, &#039;gsw&#039;},&lt;br /&gt;
	[&#039;taiwanese hokkien&#039;] = {&#039;Taiwanese Hokkien&#039;, &#039;nan-tw&#039;},					-- make room for MediaWiki/IANA/ISO 639 nan: Min Nan Chinese &lt;br /&gt;
	[&#039;tosk albanian&#039;] = {&#039;Tosk Albanian&#039;, &#039;als&#039;},								-- MediaWiki replaces &#039;Tosk Albanian&#039; with &#039;Alemannisch&#039; so &#039;Tosk Albanian&#039; cannot be found&lt;br /&gt;
	[&#039;valencian&#039;] = {&#039;Valencian&#039;, &#039;ca-valencia&#039;},								-- variant of Catalan; categorizes as Valencian&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[---------------&amp;lt; P R O P E R T I E S _ C A T E G O R I E S &amp;gt;----------------&lt;br /&gt;
&lt;br /&gt;
Properties categories. These are used for investigating qualities of citations.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local prop_cats = {&lt;br /&gt;
	[&#039;foreign-lang-source&#039;] = &#039;CS1 $1-language sources ($2)&#039;,					-- |language= categories; $1 is foreign-language name, $2 is ISO639-1 code&lt;br /&gt;
	[&#039;foreign-lang-source-2&#039;] = &#039;CS1 foreign language sources (ISO 639-2)|$1&#039;,	-- |language= category; a cat for ISO639-2 languages; $1 is the ISO 639-2 code used as a sort key&lt;br /&gt;
	[&#039;interproj-linked-name&#039;] = &#039;CS1 interproject-linked names|$1&#039;,				-- any author, editor, etc that has an interproject link; $1 is interproject tag used as a sort key&lt;br /&gt;
	[&#039;interwiki-linked-name&#039;] = &#039;CS1 interwiki-linked names|$1&#039;,				-- any author, editor, etc that has an interwiki link; $1 is interwiki tag used as a sort key; yeilds to interproject&lt;br /&gt;
	[&#039;local-lang-source&#039;] = &#039;CS1 $1-language sources ($2)&#039;,						-- |language= categories; $1 is local-language name, $2 is ISO639-1 code; not emitted when local_lang_cat_enable is false&lt;br /&gt;
	[&#039;location-test&#039;] = &#039;CS1 location test&#039;,&lt;br /&gt;
	[&#039;long-vol&#039;] = &#039;CS1: long volume value&#039;,									-- probably temporary cat to identify scope of |volume= values longer than 4 characters&lt;br /&gt;
	[&#039;script&#039;] = &#039;CS1 uses $1-language script ($2)&#039;,							-- |script-title=xx: has matching category; $1 is language name, $2 is language tag&lt;br /&gt;
	[&#039;tracked-param&#039;] = &#039;CS1 tracked parameter: $1&#039;,							-- $1 is base (enumerators removed) parameter name&lt;br /&gt;
	[&#039;unfit&#039;] = &#039;CS1: unfit URL&#039;,												-- |url-status=unfit or |url-status=usurped; used to be a maint cat&lt;br /&gt;
	[&#039;vanc-accept&#039;] = &#039;CS1:Vancouver names with accept markup&#039;,					-- for |vauthors=/|veditors= with accept-as-written markup&lt;br /&gt;
	[&#039;year-range-abbreviated&#039;] = &#039;CS1: abbreviated year range&#039;,					-- probably temporary cat to identify scope of |date=, |year= values using YYYY–YY form&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-------------------&amp;lt; T I T L E _ T Y P E S &amp;gt;--------------------------------&lt;br /&gt;
&lt;br /&gt;
Here we map a template&#039;s CitationClass to TitleType (default values for |type= parameter)&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local title_types = {&lt;br /&gt;
	[&#039;AV-media-notes&#039;] = &#039;Media notes&#039;,&lt;br /&gt;
	[&#039;document&#039;] = &#039;Document&#039;,&lt;br /&gt;
	[&#039;interview&#039;] = &#039;Interview&#039;,&lt;br /&gt;
	[&#039;mailinglist&#039;] = &#039;Mailing list&#039;,&lt;br /&gt;
	[&#039;map&#039;] = &#039;Map&#039;,&lt;br /&gt;
	[&#039;podcast&#039;] = &#039;Podcast&#039;,&lt;br /&gt;
	[&#039;pressrelease&#039;] = &#039;Press release&#039;,&lt;br /&gt;
	[&#039;report&#039;] = &#039;Report&#039;,&lt;br /&gt;
	[&#039;speech&#039;] = &#039;Speech&#039;,&lt;br /&gt;
	[&#039;techreport&#039;] = &#039;Technical report&#039;,&lt;br /&gt;
	[&#039;thesis&#039;] = &#039;Thesis&#039;,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; B U I L D _ K N O W N _ F R E E _ D O I _ R E G I S T R A N T S _ T A B L E &amp;gt;--&lt;br /&gt;
&lt;br /&gt;
build a table of doi registrants known to be free-to-read  In a doi, the registrant ID is the series of digits&lt;br /&gt;
between the &#039;10.&#039; and the first &#039;/&#039;: in doi 10.1100/sommat, 1100 is the registrant ID&lt;br /&gt;
&lt;br /&gt;
see §3.2.2 DOI prefix of the Doi Handbook p. 43&lt;br /&gt;
https://www.doi.org/doi-handbook/DOI_Handbook_Final.pdf#page=43&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function build_free_doi_registrants_table()&lt;br /&gt;
	local registrants_t = {};&lt;br /&gt;
	for _, v in ipairs ({&lt;br /&gt;
		&#039;1045&#039;, &#039;1074&#039;, &#039;1096&#039;, &#039;1100&#039;, &#039;1155&#039;, &#039;1186&#039;, &#039;1194&#039;, &#039;1371&#039;, &#039;1629&#039;, &#039;1989&#039;, &#039;1999&#039;, &#039;2147&#039;, &#039;2196&#039;, &#039;3285&#039;, &#039;3389&#039;, &#039;3390&#039;,&lt;br /&gt;
		&#039;3748&#039;, &#039;3814&#039;, &#039;3847&#039;, &#039;3897&#039;, &#039;4061&#039;, &#039;4089&#039;, &#039;4103&#039;, &#039;4172&#039;, &#039;4175&#039;, &#039;4230&#039;, &#039;4236&#039;, &#039;4239&#039;, &#039;4240&#039;, &#039;4249&#039;, &#039;4251&#039;,&lt;br /&gt;
		&#039;4252&#039;, &#039;4253&#039;, &#039;4254&#039;, &#039;4291&#039;, &#039;4292&#039;, &#039;4329&#039;, &#039;4330&#039;, &#039;4331&#039;, &#039;5194&#039;, &#039;5210&#039;, &#039;5306&#039;, &#039;5312&#039;, &#039;5313&#039;, &#039;5314&#039;,&lt;br /&gt;
		&#039;5315&#039;, &#039;5316&#039;, &#039;5317&#039;, &#039;5318&#039;, &#039;5319&#039;, &#039;5320&#039;, &#039;5321&#039;, &#039;5334&#039;, &#039;5402&#039;, &#039;5409&#039;, &#039;5410&#039;, &#039;5411&#039;, &#039;5412&#039;,&lt;br /&gt;
		&#039;5492&#039;, &#039;5493&#039;, &#039;5494&#039;, &#039;5495&#039;, &#039;5496&#039;, &#039;5497&#039;, &#039;5498&#039;, &#039;5499&#039;, &#039;5500&#039;, &#039;5501&#039;, &#039;5527&#039;, &#039;5528&#039;, &#039;5662&#039;,&lt;br /&gt;
		&#039;6064&#039;, &#039;6219&#039;, &#039;7167&#039;, &#039;7217&#039;, &#039;7287&#039;, &#039;7482&#039;, &#039;7490&#039;, &#039;7554&#039;, &#039;7717&#039;, &#039;7759&#039;, &#039;7766&#039;, &#039;9778&#039;, &#039;11131&#039;, &#039;11569&#039;, &#039;11647&#039;,&lt;br /&gt;
		&#039;11648&#039;, &#039;12688&#039;, &#039;12703&#039;, &#039;12715&#039;, &#039;12942&#039;, &#039;12998&#039;, &#039;13105&#039;, &#039;14256&#039;, &#039;14293&#039;, &#039;14303&#039;, &#039;15215&#039;, &#039;15347&#039;, &#039;15412&#039;, &#039;15560&#039;, &#039;16995&#039;,&lt;br /&gt;
		&#039;17645&#039;, &#039;18637&#039;, &#039;19080&#039;, &#039;19173&#039;, &#039;20944&#039;, &#039;21037&#039;, &#039;21468&#039;, &#039;21767&#039;, &#039;22261&#039;, &#039;22323&#039;, &#039;22459&#039;, &#039;24105&#039;, &#039;24196&#039;, &#039;24966&#039;,&lt;br /&gt;
		&#039;26775&#039;, &#039;30845&#039;, &#039;32545&#039;, &#039;35711&#039;, &#039;35712&#039;, &#039;35713&#039;, &#039;35995&#039;, &#039;36648&#039;, &#039;37126&#039;, &#039;37532&#039;, &#039;37871&#039;, &#039;47128&#039;,&lt;br /&gt;
		&#039;47622&#039;, &#039;47959&#039;, &#039;52437&#039;, &#039;52975&#039;, &#039;53288&#039;, &#039;54081&#039;, &#039;54947&#039;, &#039;55667&#039;, &#039;55914&#039;, &#039;57009&#039;, &#039;58647&#039;, &#039;59081&#039;,&lt;br /&gt;
		}) do&lt;br /&gt;
			registrants_t[v] = true;											-- build a k/v table of known free-to-read doi registrants&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return registrants_t;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local extended_registrants_t = {												-- known free registrants identifiable by the doi suffix incipit&lt;br /&gt;
	[&#039;1002&#039;] = {&#039;aelm&#039;, &#039;leap&#039;},												-- Advanced Electronic Materials, Learned Publishing&lt;br /&gt;
	[&#039;1016&#039;] = {&#039;j.heliyon&#039;, &#039;j.nlp&#039;, &#039;j.patter&#039;, &#039;j.proche&#039;},					-- Heliyon, Natural Language Processing, Patterns, Procedia Chemistry&lt;br /&gt;
	[&#039;1017&#039;] = {&#039;nlp&#039;},															-- Natural Language Processing Journal&lt;br /&gt;
	[&#039;1046&#039;] = {&#039;j.1365-8711&#039;, &#039;j.1365-246x&#039;},									-- MNRAS, GJI&lt;br /&gt;
	[&#039;1093&#039;] = {&#039;mnras&#039;, &#039;mnrasl&#039;, &#039;gji&#039;, &#039;rasti&#039;},								-- MNRAS, MNRAS Letters, GJI, RASTI&lt;br /&gt;
	[&#039;1099&#039;] = {&#039;acmi&#039;, &#039;mic&#039;, &#039;00221287&#039;, &#039;mgen&#039;},                             -- Access Microbiology, Microbiology, Journal of General Microbiology, Microbial Genomics&lt;br /&gt;
	[&#039;1111&#039;] = {&#039;j.1365-2966&#039;, &#039;j.1745-3933&#039;, &#039;j.1365-246X&#039;},					-- MNRAS, MNRAS Letters, GJI&lt;br /&gt;
	[&#039;1210&#039;] = {&#039;jendso&#039;,&#039;jcemcr&#039;},												-- Journal of the Endocrine Society, JCEM Case Reports&lt;br /&gt;
	[&#039;4171&#039;] = {&#039;dm&#039;,&#039;mag&#039;},												    -- Documenta Mathematica, EMS Magazine&lt;br /&gt;
	[&#039;11158&#039;] = {&#039;saasp&#039;},                                                      -- Systematic and Applied Acarology Special Publications&lt;br /&gt;
	[&#039;11646&#039;] = {&#039;megataxa&#039;, &#039;mesozoic&#039;},                                       -- Megataxa, Mesozoic&lt;br /&gt;
	[&#039;14231&#039;] = {&#039;ag&#039;},															-- Algebraic Geometry&lt;br /&gt;
	[&#039;22073&#039;] = {&#039;pja&#039;},                                                        -- Persian Journal of Acarology&lt;br /&gt;
	[&#039;35249&#039;] = {&#039;rche&#039;},                                                       -- Revista Chilena de Entomología&lt;br /&gt;
	[&#039;37520&#039;] = {&#039;fi&#039;},                                                         -- Fossil Imprint&lt;br /&gt;
	[&#039;53562&#039;] = {&#039;ajcb&#039;}                                                        -- Asian Journal of Conservation Biology&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[===================&amp;lt;&amp;lt; E R R O R   M E S S A G I N G &amp;gt;&amp;gt;======================&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
--[[----------&amp;lt; E R R O R   M E S S A G E   S U P P L I M E N T S &amp;gt;-------------&lt;br /&gt;
&lt;br /&gt;
I18N for those messages that are supplemented with additional specific text that&lt;br /&gt;
describes the reason for the error&lt;br /&gt;
&lt;br /&gt;
TODO: merge this with special_case_translations{}?&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local err_msg_supl = {&lt;br /&gt;
	[&#039;char&#039;] = &#039;invalid character&#039;,												-- |isbn=, |sbn=&lt;br /&gt;
	[&#039;check&#039;] = &#039;checksum&#039;,														-- |isbn=, |sbn=&lt;br /&gt;
	[&#039;flag&#039;] = &#039;flag&#039;,															-- |archive-url=&lt;br /&gt;
	[&#039;form&#039;] = &#039;invalid form&#039;,													-- |isbn=, |sbn=&lt;br /&gt;
	[&#039;group&#039;] = &#039;invalid group id&#039;,												-- |isbn=&lt;br /&gt;
	[&#039;initials&#039;] = &#039;initials&#039;,													-- Vancouver&lt;br /&gt;
	[&#039;invalid language code&#039;] = &#039;invalid language code&#039;,						-- |script-&amp;lt;param&amp;gt;=&lt;br /&gt;
	[&#039;journal&#039;] = &#039;journal&#039;,													-- |bibcode=&lt;br /&gt;
	[&#039;length&#039;] = &#039;length&#039;,														-- |isbn=, |bibcode=, |sbn=&lt;br /&gt;
	[&#039;liveweb&#039;] = &#039;liveweb&#039;,													-- |archive-url=&lt;br /&gt;
	[&#039;missing comma&#039;] = &#039;missing comma&#039;,										-- Vancouver&lt;br /&gt;
	[&#039;missing prefix&#039;] = &#039;missing prefix&#039;,										-- |script-&amp;lt;param&amp;gt;=&lt;br /&gt;
	[&#039;missing title part&#039;] = &#039;missing title part&#039;,								-- |script-&amp;lt;param&amp;gt;=&lt;br /&gt;
	[&#039;name&#039;] = &#039;name&#039;,															-- Vancouver&lt;br /&gt;
	[&#039;non-Latin char&#039;] = &#039;non-Latin character&#039;,									-- Vancouver&lt;br /&gt;
	[&#039;path&#039;] = &#039;path&#039;,															-- |archive-url=&lt;br /&gt;
	[&#039;prefix&#039;] = &#039;invalid prefix&#039;,												-- |isbn=&lt;br /&gt;
	[&#039;punctuation&#039;] = &#039;punctuation&#039;,											-- Vancouver&lt;br /&gt;
	[&#039;save&#039;] = &#039;save command&#039;,													-- |archive-url=&lt;br /&gt;
	[&#039;suffix&#039;] = &#039;suffix&#039;,														-- Vancouver&lt;br /&gt;
	[&#039;timestamp&#039;] = &#039;timestamp&#039;,												-- |archive-url=&lt;br /&gt;
	[&#039;unknown language code&#039;] = &#039;unknown language code&#039;,						-- |script-&amp;lt;param&amp;gt;=&lt;br /&gt;
	[&#039;value&#039;] = &#039;value&#039;,														-- |bibcode=&lt;br /&gt;
	[&#039;year&#039;] = &#039;year&#039;,															-- |bibcode=&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------&amp;lt; E R R O R _ C O N D I T I O N S &amp;gt;---------------------------&lt;br /&gt;
&lt;br /&gt;
Error condition table.  This table has two sections: errors at the top, maintenance&lt;br /&gt;
at the bottom.  Maint &#039;messaging&#039; does not have a &#039;message&#039; (message=nil)&lt;br /&gt;
&lt;br /&gt;
The following contains a list of IDs for various error conditions defined in the&lt;br /&gt;
code.  For each ID, we specify a text message to display, an error category to&lt;br /&gt;
include, and whether the error message should be wrapped as a hidden comment.&lt;br /&gt;
&lt;br /&gt;
Anchor changes require identical changes to matching anchor in Help:CS1 errors&lt;br /&gt;
&lt;br /&gt;
TODO: rename error_conditions{} to something more generic; create separate error&lt;br /&gt;
and maint tables inside that?&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local error_conditions = {&lt;br /&gt;
	err_accessdate_missing_url = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;access-date=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;&#039;,&lt;br /&gt;
		anchor = &#039;accessdate_missing_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: access-date without URL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
 		},&lt;br /&gt;
	err_apostrophe_markup = {&lt;br /&gt;
		message = &#039;Italic or bold markup not allowed in: &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;apostrophe_markup&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: markup&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
 		},&lt;br /&gt;
	err_archive_date_missing_url = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-date=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-url=&amp;lt;/code&amp;gt;&#039;,&lt;br /&gt;
		anchor = &#039;archive_date_missing_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: archive-url&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_archive_date_url_ts_mismatch = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-date=&amp;lt;/code&amp;gt; / &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-url=&amp;lt;/code&amp;gt; timestamp mismatch; $1 suggested&#039;,&lt;br /&gt;
		anchor = &#039;archive_date_url_ts_mismatch&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: archive-url&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_archive_missing_date = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-url=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-date=&amp;lt;/code&amp;gt;&#039;,&lt;br /&gt;
		anchor = &#039;archive_missing_date&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: archive-url&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_archive_missing_url = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-url=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;&#039;,&lt;br /&gt;
		anchor = &#039;archive_missing_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: archive-url&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_archive_url = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;archive-url=&amp;lt;/code&amp;gt; is malformed: $1&#039;,	-- $1 is error message detail&lt;br /&gt;
		anchor = &#039;archive_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: archive-url&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_arxiv_missing = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;arxiv=&amp;lt;/code&amp;gt; required&#039;,&lt;br /&gt;
		anchor = &#039;arxiv_missing&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: arXiv&#039;,											-- same as bad arxiv&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_asintld_missing_asin = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;asin=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;asintld_missing_asin&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: ASIN TLD&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_arxiv = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;arxiv=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_arxiv&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: arXiv&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_asin = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;asin=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_asin&#039;,&lt;br /&gt;
		category =&#039;CS1 errors: ASIN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_asin_tld = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;asin-tld=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_asin_tld&#039;,&lt;br /&gt;
		category =&#039;CS1 errors: ASIN TLD&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_bibcode = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;bibcode=&amp;lt;/code&amp;gt; $1&#039;,		-- $1 is error message detail&lt;br /&gt;
		anchor = &#039;bad_bibcode&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: bibcode&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_biorxiv = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;biorxiv=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_biorxiv&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: bioRxiv&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_citeseerx = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;citeseerx=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_citeseerx&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: citeseerx&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_date = {&lt;br /&gt;
		message = &#039;Check date values in: $1&#039;,									-- $1 is a parameter name list&lt;br /&gt;
		anchor = &#039;bad_date&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: dates&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_doi = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;doi=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_doi&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: DOI&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_hdl = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;hdl=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_hdl&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: HDL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_isbn = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;isbn=&amp;lt;/code&amp;gt; value: $1&#039;,	-- $1 is error message detail&lt;br /&gt;
		anchor = &#039;bad_isbn&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: ISBN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_ismn = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;ismn=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_ismn&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: ISMN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_issn = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1issn=&amp;lt;/code&amp;gt; value&#039;,	-- $1 is &#039;e&#039; or &#039;&#039; for eissn or issn&lt;br /&gt;
		anchor = &#039;bad_issn&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: ISSN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_jfm = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;jfm=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_jfm&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: JFM&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_jstor = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;jstor=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_jstor&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: JSTOR&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_lccn = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;lccn=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_lccn&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: LCCN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_medrxiv = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;medrxiv=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_medrxiv&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: medRxiv&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_mr = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;mr=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_mr&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: MR&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_oclc = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;oclc=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_oclc&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: OCLC&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_ol = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;ol=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_ol&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: OL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_osti = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;osti=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_osti&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: OSTI&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_paramlink = {														-- for |title-link=, |author/editor/translator-link=, |series-link=, |episode-link=&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; value&#039;,		-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;bad_paramlink&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: parameter link&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_pmc = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;pmc=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_pmc&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: PMC&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_pmid = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;pmid=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_pmid&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: PMID&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_rfc = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;rfc=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_rfc&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: RFC&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_s2cid = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;s2cid=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_s2cid&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: S2CID&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_sbn = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;sbn=&amp;lt;/code&amp;gt; value: $1&#039;,	-- $1 is error message detail&lt;br /&gt;
		anchor = &#039;bad_sbn&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: SBN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_ssrn = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;ssrn=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_ssrn&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: SSRN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_url = {&lt;br /&gt;
		message = &#039;Check $1 value&#039;,												-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;bad_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: URL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_usenet_id = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;message-id=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_message_id&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: message-id&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bad_zbl = {&lt;br /&gt;
		message = &#039;Check &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;zbl=&amp;lt;/code&amp;gt; value&#039;,&lt;br /&gt;
		anchor = &#039;bad_zbl&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: Zbl&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_bare_url_missing_title = {&lt;br /&gt;
		message = &#039;$1 missing title&#039;,											-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;bare_url_missing_title&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: bare URL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_biorxiv_missing = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;biorxiv=&amp;lt;/code&amp;gt; required&#039;,&lt;br /&gt;
		anchor = &#039;biorxiv_missing&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: bioRxiv&#039;,										-- same as bad bioRxiv&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_chapter_ignored = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; ignored&#039;,			-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;chapter_ignored&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: chapter ignored&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_citation_missing_title = {&lt;br /&gt;
		message = &#039;Missing or empty &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;citation_missing_title&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: missing title&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_citeseerx_missing = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;citeseerx=&amp;lt;/code&amp;gt; required&#039;,&lt;br /&gt;
		anchor = &#039;citeseerx_missing&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: citeseerx&#039;,										-- same as bad citeseerx&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_cite_web_url = {														-- this error applies to cite web and to cite podcast&lt;br /&gt;
		message = &#039;Missing or empty &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;&#039;,&lt;br /&gt;
		anchor = &#039;cite_web_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: requires URL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_class_ignored = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;class=&amp;lt;/code&amp;gt; ignored&#039;,&lt;br /&gt;
		anchor = &#039;class_ignored&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: class&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_contributor_ignored = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;contributor=&amp;lt;/code&amp;gt; ignored&#039;,&lt;br /&gt;
		anchor = &#039;contributor_ignored&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: contributor&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_contributor_missing_required_param = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;contributor=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;contributor_missing_required_param&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: contributor&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_deprecated_params = {&lt;br /&gt;
		message = &#039;Cite uses deprecated parameter &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;deprecated_params&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: deprecated parameters&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_disp_name = {&lt;br /&gt;
		message = &#039;Invalid &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=$2&amp;lt;/code&amp;gt;&#039;,			-- $1 is parameter name; $2 is the assigned value&lt;br /&gt;
		anchor = &#039;disp_name&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: display-names&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_doibroken_missing_doi = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;doi=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;doibroken_missing_doi&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: DOI&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_embargo_missing_pmc = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;pmc=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;embargo_missing_pmc&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: PMC embargo&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_empty_citation = {&lt;br /&gt;
		message = &#039;Empty citation&#039;,&lt;br /&gt;
		anchor = &#039;empty_citation&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: empty citation&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_etal = {&lt;br /&gt;
		message = &#039;Explicit use of et al. in: &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;explicit_et_al&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: explicit use of et al.&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_extra_text_edition = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;edition=&amp;lt;/code&amp;gt; has extra text&#039;,&lt;br /&gt;
		anchor = &#039;extra_text_edition&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: extra text: edition&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_extra_text_issue = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; has extra text&#039;,		-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;extra_text_issue&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: extra text: issue&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_extra_text_pages = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; has extra text&#039;,		-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;extra_text_pages&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: extra text: pages&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_extra_text_volume = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; has extra text&#039;,		-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;extra_text_volume&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: extra text: volume&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_first_missing_last = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; missing &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt;&#039;,	-- $1 is first alias, $2 is matching last alias&lt;br /&gt;
		anchor = &#039;first_missing_last&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: missing name&#039;,									-- author, contributor, editor, interviewer, translator&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_format_missing_url = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt;&#039;,	-- $1 is format parameter $2 is url parameter&lt;br /&gt;
		anchor = &#039;format_missing_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: format without URL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_generic_name = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; has generic name&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;generic_name&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: generic name&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_generic_title = {&lt;br /&gt;
		message = &#039;Cite uses generic title&#039;,&lt;br /&gt;
		anchor = &#039;generic_title&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: generic title&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_invalid_isbn_date = {&lt;br /&gt;
		message = &#039;ISBN / Date incompatibility&#039;,&lt;br /&gt;
		anchor = &#039;invalid_isbn_date&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: ISBN date&#039;,&lt;br /&gt;
		hidden = true&lt;br /&gt;
		},&lt;br /&gt;
	err_invalid_param_val = {&lt;br /&gt;
		message = &#039;Invalid &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=$2&amp;lt;/code&amp;gt;&#039;,			-- $1 is parameter name $2 is parameter value&lt;br /&gt;
		anchor = &#039;invalid_param_val&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: invalid parameter value&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_invisible_char = {&lt;br /&gt;
		message = &#039;$1 in $2 at position $3&#039;,									-- $1 is invisible char $2 is parameter name $3 is position number&lt;br /&gt;
		anchor = &#039;invisible_char&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: invisible characters&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_medrxiv_missing = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;medrxiv=&amp;lt;/code&amp;gt; required&#039;,&lt;br /&gt;
		anchor = &#039;medrxiv_missing&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: medRxiv&#039;,										-- same as bad medRxiv&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_missing_name = {&lt;br /&gt;
		message = &#039;Missing &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1$2=&amp;lt;/code&amp;gt;&#039;,			-- $1 is modified NameList; $2 is enumerator&lt;br /&gt;
		anchor = &#039;missing_name&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: missing name&#039;,									-- author, contributor, editor, interviewer, translator&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_missing_periodical = {&lt;br /&gt;
		message = &#039;Cite $1 requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt;&#039;,	-- $1 is cs1 template name; $2 is canonical periodical parameter name for cite $1&lt;br /&gt;
		anchor = &#039;missing_periodical&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: missing periodical&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_missing_pipe = {&lt;br /&gt;
		message = &#039;Missing pipe in: &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;missing_pipe&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: missing pipe&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_missing_publisher = {&lt;br /&gt;
		message = &#039;Cite $1 requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt;&#039;,	-- $1 is cs1 template name; $2 is canonical publisher parameter name for cite $1&lt;br /&gt;
		anchor = &#039;missing_publisher&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: missing publisher&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_numeric_names = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; has numeric name&#039;,	-- $1 is parameter name&#039;,&lt;br /&gt;
		anchor = &#039;numeric_names&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: numeric name&#039;,&lt;br /&gt;
		hidden = false,&lt;br /&gt;
		},&lt;br /&gt;
	err_param_access_requires_param = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1-access=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;param_access_requires_param&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: param-access&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_param_has_ext_link = {&lt;br /&gt;
		message = &#039;External link in &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;$1&amp;lt;/code&amp;gt;&#039;,			-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;param_has_ext_link&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: external links&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_param_has_twl_url = {&lt;br /&gt;
		message = &#039;Wikipedia Library link in &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;$1&amp;lt;/code&amp;gt;&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;param_has_twl_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: URL&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_parameter_ignored = {&lt;br /&gt;
		message = &#039;Unknown parameter &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; ignored&#039;,	-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;parameter_ignored&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: unsupported parameter&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_parameter_ignored_suggest = {&lt;br /&gt;
		message = &#039;Unknown parameter &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; ignored (&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt; suggested)&#039;,	-- $1 is unknown parameter $2 is suggested parameter name&lt;br /&gt;
		anchor = &#039;parameter_ignored_suggest&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: unsupported parameter&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_periodical_ignored = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; ignored&#039;,			-- $1 is parameter name&lt;br /&gt;
		anchor = &#039;periodical_ignored&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: periodical ignored&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_redundant_parameters = {&lt;br /&gt;
		message = &#039;More than one of $1 specified&#039;,								-- $1 is error message detail&lt;br /&gt;
		anchor = &#039;redundant_parameters&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: redundant parameter&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_script_parameter = {&lt;br /&gt;
		message = &#039;Invalid &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;: $2&#039;,		-- $1 is parameter name $2 is script language code or error detail&lt;br /&gt;
		anchor = &#039;script_parameter&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: script parameters&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_ssrn_missing = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;ssrn=&amp;lt;/code&amp;gt; required&#039;,&lt;br /&gt;
		anchor = &#039;ssrn_missing&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: SSRN&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_text_ignored = {&lt;br /&gt;
		message = &#039;Text &amp;quot;$1&amp;quot; ignored&#039;,											-- $1 is ignored text&lt;br /&gt;
		anchor = &#039;text_ignored&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: unrecognized parameter&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_trans_missing_title = {&lt;br /&gt;
		message = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;trans-$1=&amp;lt;/code&amp;gt; requires &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; or &amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;&amp;amp;#124;script-$1=&amp;lt;/code&amp;gt;&#039;,	-- $1 is base parameter name&lt;br /&gt;
		anchor = &#039;trans_missing_title&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: translated title&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_param_unknown_empty = {&lt;br /&gt;
		message = &#039;Cite has empty unknown parameter$1: $2&#039;,						-- $1 is &#039;s&#039; or empty space; $2 is emty unknown param list&lt;br /&gt;
		anchor = &#039;param_unknown_empty&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: empty unknown parameters&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_vancouver = {&lt;br /&gt;
		message = &#039;Vancouver style error: $1 in name $2&#039;,						-- $1 is error detail, $2 is the nth name&lt;br /&gt;
		anchor = &#039;vancouver&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: Vancouver style&#039;,&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
	err_wikilink_in_url = {&lt;br /&gt;
		message = &#039;URL–wikilink conflict&#039;,										-- uses ndash&lt;br /&gt;
		anchor = &#039;wikilink_in_url&#039;,&lt;br /&gt;
		category = &#039;CS1 errors: URL–wikilink conflict&#039;,							-- uses ndash&lt;br /&gt;
		hidden = false&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M A I N T &amp;gt;-------------------------------------&lt;br /&gt;
&lt;br /&gt;
maint messages do not have a message (message = nil); otherwise the structure&lt;br /&gt;
is the same as error messages&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
	maint_archived_copy = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;archived_copy&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: archived copy as title&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_bibcode = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;bibcode&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: bibcode&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_location_no_publisher = {												-- cite book, conference, encyclopedia; citation as book cite or encyclopedia cite&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;location_no_publisher&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: location missing publisher&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_bot_unknown = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;bot:_unknown&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: bot: original URL status unknown&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_date_auto_xlated = {													-- date auto-translation not supported by en.wiki&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;date_auto_xlated&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: date auto-translated&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_date_format = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;date_format&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: date format&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_date_year = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;date_year&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: date and year&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_doi_ignore = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;doi_ignore&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: ignored DOI errors&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_doi_inactive = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;doi_inactive&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: DOI inactive&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_doi_inactive_dated = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;doi_inactive_dated&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: DOI inactive as of $2$3$1&#039;,						-- $1 is year, $2 is month-name or empty string, $3 is space or empty string&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_doi_unflagged_free = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;doi_unflagged_free&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: unflagged free DOI&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_extra_punct = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;extra_punct&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: extra punctuation&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_id_limit_load_fail = {												-- applies to all cs1|2 templates on a page; &lt;br /&gt;
		message = nil,															-- maint message (category link) never emitted&lt;br /&gt;
		anchor = &#039;id_limit_load_fail&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: ID limit load fail&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_isbn_ignore = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;ignore_isbn_err&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: ignored ISBN errors&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_issn_ignore = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;ignore_issn&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: ignored ISSN errors&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_jfm_format = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;jfm_format&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: JFM format&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_location = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;location&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: location&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_missing_class = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;missing_class&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: missing class&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_mr_format = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;mr_format&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: MR format&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_mult_names = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;mult_names&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: multiple names: $1&#039;,								-- $1 is &#039;&amp;lt;name&amp;gt;s list&#039;; gets value from special_case_translation table&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_numeric_names = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;numeric_names&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: numeric names: $1&#039;,								-- $1 is &#039;&amp;lt;name&amp;gt;s list&#039;; gets value from special_case_translation table&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_others = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;others&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: others&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_others_avm = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;others_avm&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: others in cite AV media (notes)&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_overridden_setting = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;overridden&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: overridden setting&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_page_art_num = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;page_art_num&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: article number as page number&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_pmc_embargo = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;embargo&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: PMC embargo expired&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_pmc_format = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;pmc_format&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: PMC format&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_postscript = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;postscript&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: postscript&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
	},&lt;br /&gt;
	maint_publisher_location = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;publisher_location&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: publisher location&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
	},&lt;br /&gt;
	maint_ref_duplicates_default = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;ref_default&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: ref duplicates default&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
	},&lt;br /&gt;
	maint_unknown_lang = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;unknown_lang&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: unrecognized language&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_untitled = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;untitled&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: untitled periodical&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_url_status = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;url_status&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: url-status&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_year= {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;year&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: year&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	maint_zbl = {&lt;br /&gt;
		message = nil,&lt;br /&gt;
		anchor = &#039;zbl&#039;,&lt;br /&gt;
		category = &#039;CS1 maint: Zbl&#039;,&lt;br /&gt;
		hidden = true,&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I D _ L I M I T S _ D A T A _ T &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
fetch id limits for certain identifiers from c:Data:CS1/Identifier limits.tab.  This source is a json tabular &lt;br /&gt;
data file maintained at wikipedia commons.  Convert the json format to a table of k/v pairs.&lt;br /&gt;
&lt;br /&gt;
The values from &amp;lt;id_limits_data_t&amp;gt; are used to set handle.id_limit.&lt;br /&gt;
&lt;br /&gt;
From 2025-02-21, MediaWiki is broken.  Use this link to edit the tablular data file:&lt;br /&gt;
	https://commons.wikimedia.org/w/index.php?title=Data:CS1/Identifier_limits.tab&amp;amp;action=edit&lt;br /&gt;
See Phab:T389105&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local id_limits_data_t = {};&lt;br /&gt;
&lt;br /&gt;
local use_commons_data = true;													-- set to false if your wiki does not have access to mediawiki commons; then,&lt;br /&gt;
if false == use_commons_data then												-- update this table from https://commons.wikimedia.org/wiki/Data:CS1/Identifier_limits.tab; last update: 2025-02-21&lt;br /&gt;
	id_limits_data_t = {[&#039;OCLC&#039;] = 10450000000, [&#039;OSTI&#039;] = 23010000, [&#039;PMC&#039;] = 11900000, [&#039;PMID&#039;] = 40400000, [&#039;RFC&#039;] = 9300, [&#039;SSRN&#039;] = 5200000, [&#039;S2CID&#039;] = 276000000};	-- this table must be maintained locally&lt;br /&gt;
&lt;br /&gt;
else																			-- here for wikis that do have access to mediawiki commons&lt;br /&gt;
	local load_fail_limit = 99999999999;										-- very high number to avoid error messages on load failure&lt;br /&gt;
	id_limits_data_t = {[&#039;OCLC&#039;] = load_fail_limit, [&#039;OSTI&#039;] = load_fail_limit, [&#039;PMC&#039;] = load_fail_limit, [&#039;PMID&#039;] = load_fail_limit, [&#039;RFC&#039;] = load_fail_limit, [&#039;SSRN&#039;] = load_fail_limit, [&#039;S2CID&#039;] = load_fail_limit};&lt;br /&gt;
&lt;br /&gt;
	local id_limits_data_load_fail = false;										-- flag; assume that we will be successful when loading json id limit tabular data&lt;br /&gt;
	&lt;br /&gt;
	local tab_data_t = mw.ext.data.get (&#039;CS1/Identifier limits.tab&#039;);			-- attempt to load the tabular data from commons into &amp;lt;tab_data_t&amp;gt;&lt;br /&gt;
	if false == tab_data_t then													-- undocumented &#039;feature&#039;: mw.ext.data.get() sometimes returns false&lt;br /&gt;
		id_limits_data_load_fail = true;										-- set the flag so that Module:Citation/CS1 can create an unannotated maint category&lt;br /&gt;
	else&lt;br /&gt;
		for _, limit_t in ipairs (tab_data_t.data) do							-- overwrite default &amp;lt;load_fail_limit&amp;gt; values from the data table in the tabular data&lt;br /&gt;
			id_limits_data_t[limit_t[1]] = limit_t[2];							-- &amp;lt;limit[1]&amp;gt; is identifier; &amp;lt;limit[2]&amp;gt; is upper limit for that identifier&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I D _ H A N D L E R S &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
The following contains a list of values for various defined identifiers.  For each&lt;br /&gt;
identifier we specify a variety of information necessary to properly render the&lt;br /&gt;
identifier in the citation.&lt;br /&gt;
&lt;br /&gt;
	parameters: a list of parameter aliases for this identifier; first in the list is the canonical form&lt;br /&gt;
	link: Wikipedia article name&lt;br /&gt;
	redirect: a local redirect to a local Wikipedia article name;  at en.wiki, &#039;ISBN (identifier)&#039; is a redirect to &#039;International Standard Book Number&#039;&lt;br /&gt;
	q: Wikidata q number for the identifier&lt;br /&gt;
	label: the label preceding the identifier; label is linked to a Wikipedia article (in this order):&lt;br /&gt;
		redirect from id_handlers[&#039;&amp;lt;id&amp;gt;&#039;].redirect when use_identifier_redirects is true&lt;br /&gt;
		Wikidata-supplied article name for the local wiki from id_handlers[&#039;&amp;lt;id&amp;gt;&#039;].q&lt;br /&gt;
		local article name from id_handlers[&#039;&amp;lt;id&amp;gt;&#039;].link&lt;br /&gt;
	prefix: the first part of a URL that will be concatenated with a second part which usually contains the identifier&lt;br /&gt;
	suffix: optional third part to be added after the identifier&lt;br /&gt;
	encode: true if URI should be percent-encoded; otherwise false&lt;br /&gt;
	COinS: identifier link or keyword for use in COinS:&lt;br /&gt;
		for identifiers registered at info-uri.info use: info:.... where &#039;...&#039; is the appropriate identifier label &lt;br /&gt;
		for identifiers that have COinS keywords, use the keyword: rft.isbn, rft.issn, rft.eissn&lt;br /&gt;
		for |asin= and |ol=, which require assembly, use the keyword: url&lt;br /&gt;
		for others make a URL using the value in prefix/suffix and #label, use the keyword: pre (not checked; any text other than &#039;info&#039;, &#039;rft&#039;, or &#039;url&#039; works here)&lt;br /&gt;
		set to nil to leave the identifier out of the COinS&lt;br /&gt;
	separator: character or text between label and the identifier in the rendered citation&lt;br /&gt;
	id_limit: for those identifiers with established limits, this property holds the upper limit&lt;br /&gt;
	access: use this parameter to set the access level for all instances of this identifier.&lt;br /&gt;
		the value must be a valid access level for an identifier (see [&#039;id-access&#039;] in this file).&lt;br /&gt;
	custom_access: to enable custom access level for an identifier, set this parameter&lt;br /&gt;
		to the parameter that should control it (normally &#039;id-access&#039;)&lt;br /&gt;
		&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local id_handlers = {&lt;br /&gt;
	[&#039;ARXIV&#039;] = {&lt;br /&gt;
		parameters = {&#039;arxiv&#039;, &#039;eprint&#039;},&lt;br /&gt;
		link = &#039;arXiv&#039;,&lt;br /&gt;
		redirect = &#039;arXiv (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q118398&#039;,&lt;br /&gt;
		label = &#039;arXiv&#039;,&lt;br /&gt;
		prefix = &#039;https://arxiv.org/abs/&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		COinS = &#039;info:arxiv&#039;,&lt;br /&gt;
		separator = &#039;:&#039;,&lt;br /&gt;
		access = &#039;free&#039;,														-- free to read&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;ASIN&#039;] = {&lt;br /&gt;
		parameters = { &#039;asin&#039;, &#039;ASIN&#039; },&lt;br /&gt;
		link = &#039;Amazon Standard Identification Number&#039;,&lt;br /&gt;
		redirect = &#039;ASIN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q1753278&#039;,&lt;br /&gt;
		label = &#039;ASIN&#039;,&lt;br /&gt;
		prefix = &#039;https://www.amazon.&#039;,&lt;br /&gt;
		COinS = &#039;url&#039;,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		encode = false;&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;BIBCODE&#039;] = {&lt;br /&gt;
		parameters = {&#039;bibcode&#039;},&lt;br /&gt;
		link = &#039;Bibcode&#039;,&lt;br /&gt;
		redirect = &#039;Bibcode (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q25754&#039;,&lt;br /&gt;
		label = &#039;Bibcode&#039;,&lt;br /&gt;
		prefix = &#039;https://ui.adsabs.harvard.edu/abs/&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		COinS = &#039;info:bibcode&#039;,&lt;br /&gt;
		separator = &#039;:&#039;,&lt;br /&gt;
		custom_access = &#039;bibcode-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;BIORXIV&#039;] = {&lt;br /&gt;
		parameters = {&#039;biorxiv&#039;},&lt;br /&gt;
		link = &#039;bioRxiv&#039;,&lt;br /&gt;
		redirect = &#039;bioRxiv (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q19835482&#039;,&lt;br /&gt;
		label = &#039;bioRxiv&#039;,&lt;br /&gt;
		prefix = &#039;https://doi.org/&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		access = &#039;free&#039;,														-- free to read&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;CITESEERX&#039;] = {&lt;br /&gt;
		parameters = {&#039;citeseerx&#039;},&lt;br /&gt;
		link = &#039;CiteSeerX&#039;,&lt;br /&gt;
		redirect = &#039;CiteSeerX (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q2715061&#039;,&lt;br /&gt;
		label = &#039;CiteSeerX&#039;,&lt;br /&gt;
		prefix = &#039;https://citeseerx.ist.psu.edu/viewdoc/summary?doi=&#039;,&lt;br /&gt;
		COinS =  &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		access = &#039;free&#039;,														-- free to read&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;DOI&#039;] = {																	-- Used by InternetArchiveBot&lt;br /&gt;
		parameters = { &#039;doi&#039;, &#039;DOI&#039;},&lt;br /&gt;
		link = &#039;Digital object identifier&#039;,&lt;br /&gt;
		redirect = &#039;doi (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q25670&#039;,&lt;br /&gt;
		label = &#039;doi&#039;,&lt;br /&gt;
		prefix = &#039;https://doi.org/&#039;,&lt;br /&gt;
		COinS = &#039;info:doi&#039;,&lt;br /&gt;
		separator = &#039;:&#039;,&lt;br /&gt;
		encode = true,&lt;br /&gt;
		custom_access = &#039;doi-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;EISSN&#039;] = {&lt;br /&gt;
		parameters = {&#039;eissn&#039;, &#039;EISSN&#039;},&lt;br /&gt;
		link = &#039;International Standard Serial Number#Electronic ISSN&#039;,&lt;br /&gt;
		redirect = &#039;eISSN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q46339674&#039;,&lt;br /&gt;
		label = &#039;eISSN&#039;,&lt;br /&gt;
		prefix = &#039;https://search.worldcat.org/issn/&#039;,&lt;br /&gt;
		COinS = &#039;rft.eissn&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;HDL&#039;] = {&lt;br /&gt;
		parameters = { &#039;hdl&#039;, &#039;HDL&#039; },&lt;br /&gt;
		link = &#039;Handle System&#039;,&lt;br /&gt;
		redirect = &#039;hdl (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q3126718&#039;,&lt;br /&gt;
		label = &#039;hdl&#039;,&lt;br /&gt;
		prefix = &#039;https://hdl.handle.net/&#039;,&lt;br /&gt;
		COinS = &#039;info:hdl&#039;,&lt;br /&gt;
		separator = &#039;:&#039;,&lt;br /&gt;
		encode = true,&lt;br /&gt;
		custom_access = &#039;hdl-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;ISBN&#039;] = {																-- Used by InternetArchiveBot&lt;br /&gt;
		parameters = {&#039;isbn&#039;, &#039;ISBN&#039;},&lt;br /&gt;
		link = &#039;International Standard Book Number&#039;,&lt;br /&gt;
		redirect = &#039;ISBN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q33057&#039;,&lt;br /&gt;
		label = &#039;ISBN&#039;,&lt;br /&gt;
		prefix = &#039;Special:BookSources/&#039;,&lt;br /&gt;
		COinS = &#039;rft.isbn&#039;,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;ISMN&#039;] = {&lt;br /&gt;
		parameters = {&#039;ismn&#039;, &#039;ISMN&#039;},&lt;br /&gt;
		link = &#039;International Standard Music Number&#039;,&lt;br /&gt;
		redirect = &#039;ISMN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q1666938&#039;,&lt;br /&gt;
		label = &#039;ISMN&#039;,&lt;br /&gt;
		prefix = &#039;&#039;,															-- not currently used;&lt;br /&gt;
		COinS = nil,															-- nil because we can&#039;t use pre or rft or info:&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;ISSN&#039;] = {&lt;br /&gt;
		parameters = {&#039;issn&#039;, &#039;ISSN&#039;},&lt;br /&gt;
		link = &#039;International Standard Serial Number&#039;,&lt;br /&gt;
		redirect = &#039;ISSN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q131276&#039;,&lt;br /&gt;
		label = &#039;ISSN&#039;,&lt;br /&gt;
		prefix = &#039;https://search.worldcat.org/issn/&#039;,&lt;br /&gt;
		COinS = &#039;rft.issn&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;JFM&#039;] = {&lt;br /&gt;
		parameters = {&#039;jfm&#039;, &#039;JFM&#039;},&lt;br /&gt;
		link = &#039;Jahrbuch über die Fortschritte der Mathematik&#039;,&lt;br /&gt;
		redirect = &#039;JFM (identifier)&#039;,&lt;br /&gt;
		q = &#039;&#039;,&lt;br /&gt;
		label = &#039;JFM&#039;,&lt;br /&gt;
		prefix = &#039;https://zbmath.org/?format=complete&amp;amp;q=an:&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;JSTOR&#039;] = {&lt;br /&gt;
		parameters = {&#039;jstor&#039;, &#039;JSTOR&#039;},&lt;br /&gt;
		link = &#039;JSTOR&#039;,&lt;br /&gt;
		redirect = &#039;JSTOR (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q1420342&#039;,&lt;br /&gt;
		label = &#039;JSTOR&#039;,&lt;br /&gt;
		prefix = &#039;https://www.jstor.org/stable/&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		custom_access = &#039;jstor-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;LCCN&#039;] = {&lt;br /&gt;
		parameters = {&#039;lccn&#039;, &#039;LCCN&#039;},&lt;br /&gt;
		link = &#039;Library of Congress Control Number&#039;,&lt;br /&gt;
		redirect = &#039;LCCN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q620946&#039;,&lt;br /&gt;
		label = &#039;LCCN&#039;,&lt;br /&gt;
		prefix = &#039;https://lccn.loc.gov/&#039;,&lt;br /&gt;
		COinS = &#039;info:lccn&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;MEDRXIV&#039;] = {&lt;br /&gt;
		parameters = {&#039;medrxiv&#039;},&lt;br /&gt;
		link = &#039;medRxiv&#039;,&lt;br /&gt;
		redirect = &#039;medRxiv (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q58465838&#039;,&lt;br /&gt;
		label = &#039;medRxiv&#039;,&lt;br /&gt;
		prefix = &#039;https://www.medrxiv.org/content/&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		access = &#039;free&#039;,														-- free to read&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;MR&#039;] = {&lt;br /&gt;
		parameters = {&#039;mr&#039;, &#039;MR&#039;},&lt;br /&gt;
		link = &#039;Mathematical Reviews&#039;,&lt;br /&gt;
		redirect = &#039;MR (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q211172&#039;,&lt;br /&gt;
		label = &#039;MR&#039;,&lt;br /&gt;
		prefix = &#039;https://mathscinet.ams.org/mathscinet-getitem?mr=&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;OCLC&#039;] = {&lt;br /&gt;
		parameters = {&#039;oclc&#039;, &#039;OCLC&#039;},&lt;br /&gt;
		link = &#039;OCLC&#039;,&lt;br /&gt;
		redirect = &#039;OCLC (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q190593&#039;,&lt;br /&gt;
		label = &#039;OCLC&#039;,&lt;br /&gt;
		prefix = &#039;https://search.worldcat.org/oclc/&#039;,&lt;br /&gt;
		COinS = &#039;info:oclcnum&#039;,&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.OCLC or 0,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;OL&#039;] = {&lt;br /&gt;
		parameters = { &#039;ol&#039;, &#039;OL&#039; },&lt;br /&gt;
		link = &#039;Open Library&#039;,&lt;br /&gt;
		redirect = &#039;OL (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q1201876&#039;,&lt;br /&gt;
		label = &#039;OL&#039;,&lt;br /&gt;
		prefix = &#039;https://openlibrary.org/&#039;,&lt;br /&gt;
		COinS = &#039;url&#039;,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		encode = true,&lt;br /&gt;
		custom_access = &#039;ol-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;OSTI&#039;] = {&lt;br /&gt;
		parameters = {&#039;osti&#039;, &#039;OSTI&#039;},&lt;br /&gt;
		link = &#039;Office of Scientific and Technical Information&#039;,&lt;br /&gt;
		redirect = &#039;OSTI (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q2015776&#039;,&lt;br /&gt;
		label = &#039;OSTI&#039;,&lt;br /&gt;
		prefix = &#039;https://www.osti.gov/biblio/&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.OSTI or 0,&lt;br /&gt;
		custom_access = &#039;osti-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;PMC&#039;] = {&lt;br /&gt;
		parameters = {&#039;pmc&#039;, &#039;PMC&#039;},&lt;br /&gt;
		link = &#039;PubMed Central&#039;,&lt;br /&gt;
		redirect = &#039;PMC (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q229883&#039;,&lt;br /&gt;
		label = &#039;PMC&#039;,&lt;br /&gt;
		prefix = &#039;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC&#039;,&lt;br /&gt;
		suffix = &#039;&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.PMC or 0,&lt;br /&gt;
		access = &#039;free&#039;,														-- free to read&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;PMID&#039;] = {&lt;br /&gt;
		parameters = {&#039;pmid&#039;, &#039;PMID&#039;},&lt;br /&gt;
		link = &#039;PubMed Identifier&#039;,&lt;br /&gt;
		redirect = &#039;PMID (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q2082879&#039;,&lt;br /&gt;
		label = &#039;PMID&#039;,&lt;br /&gt;
		prefix = &#039;https://pubmed.ncbi.nlm.nih.gov/&#039;,&lt;br /&gt;
		COinS = &#039;info:pmid&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.PMID or 0,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;RFC&#039;] = {&lt;br /&gt;
		parameters = {&#039;rfc&#039;, &#039;RFC&#039;},&lt;br /&gt;
		link = &#039;Request for Comments&#039;,&lt;br /&gt;
		redirect = &#039;RFC (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q212971&#039;,&lt;br /&gt;
		label = &#039;RFC&#039;,&lt;br /&gt;
		prefix = &#039;https://tools.ietf.org/html/rfc&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.RFC or 0,&lt;br /&gt;
		access = &#039;free&#039;,														-- free to read&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;SBN&#039;] = {&lt;br /&gt;
		parameters = {&#039;sbn&#039;, &#039;SBN&#039;},&lt;br /&gt;
		link = &#039;Standard Book Number&#039;,											-- redirect to International_Standard_Book_Number#History&lt;br /&gt;
		redirect = &#039;SBN (identifier)&#039;,&lt;br /&gt;
		label = &#039;SBN&#039;,&lt;br /&gt;
		prefix = &#039;Special:BookSources/0-&#039;,										-- prefix has leading zero necessary to make 9-digit sbn a 10-digit isbn&lt;br /&gt;
		COinS = nil,															-- nil because we can&#039;t use pre or rft or info:&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;SSRN&#039;] = {&lt;br /&gt;
		parameters = {&#039;ssrn&#039;, &#039;SSRN&#039;},&lt;br /&gt;
		link = &#039;Social Science Research Network&#039;,&lt;br /&gt;
		redirect = &#039;SSRN (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q7550801&#039;,&lt;br /&gt;
		label = &#039;SSRN&#039;,&lt;br /&gt;
		prefix = &#039;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.SSRN or 0,&lt;br /&gt;
		custom_access = &#039;ssrn-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;S2CID&#039;] = {&lt;br /&gt;
		parameters = {&#039;s2cid&#039;, &#039;S2CID&#039;},&lt;br /&gt;
		link = &#039;Semantic Scholar&#039;,&lt;br /&gt;
		redirect = &#039;S2CID (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q22908627&#039;,&lt;br /&gt;
		label = &#039;S2CID&#039;,&lt;br /&gt;
		prefix = &#039;https://api.semanticscholar.org/CorpusID:&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = false,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		id_limit = id_limits_data_t.S2CID or 0,&lt;br /&gt;
		custom_access = &#039;s2cid-access&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;USENETID&#039;] = {&lt;br /&gt;
		parameters = {&#039;message-id&#039;},&lt;br /&gt;
		link = &#039;Usenet&#039;,&lt;br /&gt;
		redirect = &#039;Usenet (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q193162&#039;,&lt;br /&gt;
		label = &#039;Usenet:&#039;,&lt;br /&gt;
		prefix = &#039;news:&#039;,&lt;br /&gt;
		encode = false,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	[&#039;ZBL&#039;] = {&lt;br /&gt;
		parameters = {&#039;zbl&#039;, &#039;ZBL&#039; },&lt;br /&gt;
		link = &#039;Zentralblatt MATH&#039;,&lt;br /&gt;
		redirect = &#039;Zbl (identifier)&#039;,&lt;br /&gt;
		q = &#039;Q190269&#039;,&lt;br /&gt;
		label = &#039;Zbl&#039;,&lt;br /&gt;
		prefix = &#039;https://zbmath.org/?format=complete&amp;amp;q=an:&#039;,&lt;br /&gt;
		COinS = &#039;pre&#039;,															-- use prefix value&lt;br /&gt;
		encode = true,&lt;br /&gt;
		separator = &#039;&amp;amp;nbsp;&#039;,&lt;br /&gt;
		},&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T S &amp;gt;---------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return 	{&lt;br /&gt;
	use_identifier_redirects = use_identifier_redirects,						-- booleans defined in the settings at the top of this module&lt;br /&gt;
	local_lang_cat_enable = local_lang_cat_enable,&lt;br /&gt;
	date_name_auto_xlate_enable = date_name_auto_xlate_enable,&lt;br /&gt;
	date_digit_auto_xlate_enable = date_digit_auto_xlate_enable,&lt;br /&gt;
	enable_sort_keys = enable_sort_keys,&lt;br /&gt;
	&lt;br /&gt;
																				-- tables and variables created when this module is loaded&lt;br /&gt;
	global_df = get_date_format (),												-- this line can be replaced with &amp;quot;global_df = &#039;dmy-all&#039;,&amp;quot; to have all dates auto translated to dmy format.&lt;br /&gt;
	global_cs1_config_t = global_cs1_config_t,									-- global settings from {{cs1 config}}&lt;br /&gt;
	punct_skip = build_skip_table (punct_skip, punct_meta_params),&lt;br /&gt;
	url_skip = build_skip_table (url_skip, url_meta_params),&lt;br /&gt;
	known_free_doi_registrants_t = build_free_doi_registrants_table(),&lt;br /&gt;
	id_limits_data_load_fail = id_limits_data_load_fail,						-- true when commons tabular identifier-limit data fails to load&lt;br /&gt;
&lt;br /&gt;
	name_space_sort_keys = name_space_sort_keys,&lt;br /&gt;
	aliases = aliases,&lt;br /&gt;
	special_case_translation = special_case_translation,&lt;br /&gt;
	date_names = date_names,&lt;br /&gt;
	err_msg_supl = err_msg_supl,&lt;br /&gt;
	error_conditions = error_conditions,&lt;br /&gt;
	editor_markup_patterns = editor_markup_patterns,&lt;br /&gt;
	et_al_patterns = et_al_patterns,&lt;br /&gt;
	extended_registrants_t = extended_registrants_t,&lt;br /&gt;
	id_handlers = id_handlers,&lt;br /&gt;
	keywords_lists = keywords_lists,&lt;br /&gt;
	keywords_xlate = keywords_xlate,&lt;br /&gt;
	stripmarkers = stripmarkers,&lt;br /&gt;
	invisible_chars = invisible_chars,&lt;br /&gt;
	invisible_defs = invisible_defs,&lt;br /&gt;
	indic_script = indic_script,&lt;br /&gt;
	emoji_t = emoji_t,&lt;br /&gt;
	maint_cats = maint_cats,&lt;br /&gt;
	messages = messages,&lt;br /&gt;
	presentation = presentation,&lt;br /&gt;
	prop_cats = prop_cats,&lt;br /&gt;
	script_lang_codes = script_lang_codes,&lt;br /&gt;
	lang_tag_remap = lang_tag_remap,&lt;br /&gt;
	lang_name_remap = lang_name_remap,&lt;br /&gt;
	this_wiki_code = this_wiki_code,&lt;br /&gt;
	title_types = title_types,&lt;br /&gt;
	uncategorized_namespaces = uncategorized_namespaces_t,&lt;br /&gt;
	uncategorized_subpages = uncategorized_subpages,&lt;br /&gt;
	templates_using_volume = templates_using_volume,&lt;br /&gt;
	templates_using_issue = templates_using_issue,&lt;br /&gt;
	templates_not_using_page = templates_not_using_page,&lt;br /&gt;
	vol_iss_pg_patterns = vol_iss_pg_patterns,&lt;br /&gt;
	single_letter_2nd_lvl_domains_t = single_letter_2nd_lvl_domains_t,&lt;br /&gt;
	url_access_map_t = url_access_map_t,&lt;br /&gt;
	&lt;br /&gt;
	inter_wiki_map = inter_wiki_map,&lt;br /&gt;
	mw_languages_by_tag_t = mw_languages_by_tag_t,&lt;br /&gt;
	mw_languages_by_name_t = mw_languages_by_name_t,&lt;br /&gt;
	citation_class_map_t = citation_class_map_t,&lt;br /&gt;
&lt;br /&gt;
	citation_issue_t = citation_issue_t,&lt;br /&gt;
	citation_no_volume_t = citation_no_volume_t,&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1&amp;diff=430</id>
		<title>模块:Citation/CS1</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E5%9D%97:Citation/CS1&amp;diff=430"/>
		<updated>2025-09-28T15:21:22Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;require (&#039;strict&#039;);&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; F O R W A R D   D E C L A R A T I O N S &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
each of these counts against the Lua upvalue limit&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local validation;																-- functions in Module:Citation/CS1/Date_validation&lt;br /&gt;
&lt;br /&gt;
local utilities;																-- functions in Module:Citation/CS1/Utilities&lt;br /&gt;
local z = {};																	-- table of tables in Module:Citation/CS1/Utilities&lt;br /&gt;
&lt;br /&gt;
local identifiers;																-- functions and tables in Module:Citation/CS1/Identifiers&lt;br /&gt;
local metadata;																	-- functions in Module:Citation/CS1/COinS&lt;br /&gt;
local cfg = {};																	-- table of configuration tables that are defined in Module:Citation/CS1/Configuration&lt;br /&gt;
local whitelist = {};															-- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[------------------&amp;lt; P A G E   S C O P E   V A R I A B L E S &amp;gt;---------------&lt;br /&gt;
&lt;br /&gt;
declare variables here that have page-wide scope that are not brought in from&lt;br /&gt;
other modules; that are created here and used here&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local added_deprecated_cat;														-- Boolean flag so that the category is added only once&lt;br /&gt;
local added_vanc_errs;															-- Boolean flag so we only emit one Vancouver error / category&lt;br /&gt;
local added_generic_name_errs;													-- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered&lt;br /&gt;
local added_numeric_name_errs;													-- Boolean flag so we only emit one numeric name error / category and stop testing names once an error is encountered&lt;br /&gt;
local added_numeric_name_maint;													-- Boolean flag so we only emit one numeric name maint category and stop testing names once a category has been emitted&lt;br /&gt;
local is_preview_mode;															-- true when article is in preview mode; false when using &#039;Preview page with this template&#039; (previewing the module)&lt;br /&gt;
local is_sandbox;																-- true when using sandbox modules to render citation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; F I R S T _ S E T &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Locates and returns the first set value in a table of values where the order established in the table,&lt;br /&gt;
left-to-right (or top-to-bottom), is the order in which the values are evaluated.  Returns nil if none are set.&lt;br /&gt;
&lt;br /&gt;
This version replaces the original &#039;for _, val in pairs do&#039; and a similar version that used ipairs.  With the pairs&lt;br /&gt;
version the order of evaluation could not be guaranteed.  With the ipairs version, a nil value would terminate&lt;br /&gt;
the for-loop before it reached the actual end of the list.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function first_set (list, count)&lt;br /&gt;
	local i = 1;&lt;br /&gt;
	while i &amp;lt;= count do															-- loop through all items in list&lt;br /&gt;
		if utilities.is_set( list[i] ) then&lt;br /&gt;
			return list[i];														-- return the first set list member&lt;br /&gt;
		end&lt;br /&gt;
		i = i + 1;																-- point to next&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; A D D _ V A N C _ E R R O R &amp;gt;----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Adds a single Vancouver system error message to the template&#039;s output regardless of how many error actually exist.&lt;br /&gt;
To prevent duplication, added_vanc_errs is nil until an error message is emitted.&lt;br /&gt;
&lt;br /&gt;
added_vanc_errs is a Boolean declared in page scope variables above&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function add_vanc_error (source, position)&lt;br /&gt;
	if added_vanc_errs then return end&lt;br /&gt;
		&lt;br /&gt;
	added_vanc_errs = true;														-- note that we&#039;ve added this category&lt;br /&gt;
	utilities.set_message (&#039;err_vancouver&#039;, {source, position});&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ S C H E M E &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
does this thing that purports to be a URI scheme seem to be a valid scheme?  The scheme is checked to see if it&lt;br /&gt;
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:&lt;br /&gt;
	Scheme names consist of a sequence of characters beginning with a&lt;br /&gt;
   letter and followed by any combination of letters, digits, plus&lt;br /&gt;
   (&amp;quot;+&amp;quot;), period (&amp;quot;.&amp;quot;), or hyphen (&amp;quot;-&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
returns true if it does, else false&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_scheme (scheme)&lt;br /&gt;
	return scheme and scheme:match (&#039;^%a[%a%d%+%.%-]*:&#039;);						-- true if scheme is set and matches the pattern&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; I S _ D O M A I N _ N A M E &amp;gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Does this thing that purports to be a domain name seem to be a valid domain name?&lt;br /&gt;
&lt;br /&gt;
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5&lt;br /&gt;
BNF defined here: https://tools.ietf.org/html/rfc4234&lt;br /&gt;
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;&lt;br /&gt;
	see also [[Single-letter second-level domain]]&lt;br /&gt;
list of TLDs: https://www.iana.org/domains/root/db&lt;br /&gt;
&lt;br /&gt;
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit.  Between&lt;br /&gt;
the first and last characters the name may use letters, digits, and the hyphen.&lt;br /&gt;
&lt;br /&gt;
Also allowed are IPv4 addresses. IPv6 not supported&lt;br /&gt;
&lt;br /&gt;
domain is expected to be stripped of any path so that the last character in the last character of the TLD.  tld&lt;br /&gt;
is two or more alpha characters.  Any preceding &#039;//&#039; (from splitting a URL with a scheme) will be stripped&lt;br /&gt;
here.  Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.&lt;br /&gt;
&lt;br /&gt;
There are several tests:&lt;br /&gt;
	the first character of the whole domain name including subdomains must be a letter or a digit&lt;br /&gt;
	internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490&lt;br /&gt;
	single-letter/digit second-level domains in the .org, .cash, and .today TLDs&lt;br /&gt;
	q, x, and z SL domains in the .com TLD&lt;br /&gt;
	i and q SL domains in the .net TLD&lt;br /&gt;
	single-letter SL domains in the ccTLDs (where the ccTLD is two letters)&lt;br /&gt;
	two-character SL domains in gTLDs (where the gTLD is two or more letters)&lt;br /&gt;
	three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)&lt;br /&gt;
	IPv4 dot-decimal address format; TLD not allowed&lt;br /&gt;
&lt;br /&gt;
returns true if domain appears to be a proper name and TLD or IPv4 address, else false&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function is_domain_name (domain)&lt;br /&gt;
	if not domain then&lt;br /&gt;
		return false;															-- if not set, abandon&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	domain = domain:gsub (&#039;^//&#039;, &#039;&#039;);											-- strip &#039;//&#039; from domain name if present; done here so we only have to do it once&lt;br /&gt;
	&lt;br /&gt;
	if not domain:match (&#039;^[%w]&#039;) then											-- first character must be letter or digit&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if domain:match (&#039;^%a+:&#039;) then												-- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local patterns = {															-- patterns that look like URLs&lt;br /&gt;
		&#039;%f[%w][%w][%w%-]+[%w]%.%a%a+$&#039;,										-- three or more character hostname.hostname or hostname.tld&lt;br /&gt;
		&#039;%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$&#039;,									-- internationalized domain name with ACE prefix&lt;br /&gt;
		&#039;%f[%a][qxz]%.com$&#039;,													-- assigned one character .com hostname (x.com times out 2015-12-10)&lt;br /&gt;
		&#039;%f[%a][iq]%.net$&#039;,														-- assigned one character .net hostname (q.net registered but not active 2015-12-10)&lt;br /&gt;
		&#039;%f[%w][%w]%.%a%a$&#039;,													-- one character hostname and ccTLD (2 chars)&lt;br /&gt;
		&#039;%f[%w][%w][%w]%.%a%a+$&#039;,												-- two character hostname and TLD&lt;br /&gt;
		&#039;^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?&#039;,								-- IPv4 address&lt;br /&gt;
		&#039;[%a%d]+%:?&#039;                                                            -- IPv6 address&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	for _, pattern in ipairs (patterns) do										-- loop through the patterns list&lt;br /&gt;
		if domain:match (pattern) then&lt;br /&gt;
			return true;														-- if a match then we think that this thing that purports to be a URL is a URL&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do					-- look for single letter second level domain names for these top level domains&lt;br /&gt;
		if domain:match (&#039;%f[%w][%w]%.&#039; .. d) then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false;																-- no matches, we don&#039;t know what this thing is&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ U R L &amp;gt;------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.&lt;br /&gt;
&lt;br /&gt;
This function is the last step in the validation process.  This function is separate because there are cases that&lt;br /&gt;
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external&lt;br /&gt;
wikilinks.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_url (scheme, domain)&lt;br /&gt;
	if utilities.is_set (scheme) then											-- if scheme is set check it and domain&lt;br /&gt;
		return is_scheme (scheme) and is_domain_name (domain);&lt;br /&gt;
	else&lt;br /&gt;
		return is_domain_name (domain);											-- scheme not set when URL is protocol-relative&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S P L I T _ U R L &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Split a URL into a scheme, authority indicator, and domain.&lt;br /&gt;
&lt;br /&gt;
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).&lt;br /&gt;
&lt;br /&gt;
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.&lt;br /&gt;
&lt;br /&gt;
When not protocol-relative, get scheme, authority indicator, and domain.  If there is an authority indicator (one&lt;br /&gt;
or more &#039;/&#039; characters immediately following the scheme&#039;s colon), make sure that there are only 2.&lt;br /&gt;
&lt;br /&gt;
Any URL that does not have news: scheme must have authority indicator (//).  TODO: are there other common schemes&lt;br /&gt;
like news: that don&#039;t use authority indicator?&lt;br /&gt;
&lt;br /&gt;
Strip off any port and path;&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function split_url (url_str)&lt;br /&gt;
	local scheme, authority, domain;&lt;br /&gt;
	&lt;br /&gt;
	url_str = url_str:gsub (&#039;([%a%d])%.?[/%?#].*$&#039;, &#039;%1&#039;);						-- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of &#039;//&#039;)&lt;br /&gt;
&lt;br /&gt;
	if url_str:match (&#039;^//%S*&#039;) then											-- if there is what appears to be a protocol-relative URL&lt;br /&gt;
		domain = url_str:match (&#039;^//(%S*)&#039;)&lt;br /&gt;
	elseif url_str:match (&#039;%S-:/*%S+&#039;) then										-- if there is what appears to be a scheme, optional authority indicator, and domain name&lt;br /&gt;
		scheme, authority, domain = url_str:match (&#039;(%S-:)(/*)(%S+)&#039;);			-- extract the scheme, authority indicator, and domain portions&lt;br /&gt;
		if utilities.is_set (authority) then&lt;br /&gt;
			authority = authority:gsub (&#039;//&#039;, &#039;&#039;, 1);							-- replace place 1 pair of &#039;/&#039; with nothing;&lt;br /&gt;
			if utilities.is_set(authority) then									-- if anything left (1 or 3+ &#039;/&#039; where authority should be) then&lt;br /&gt;
				return scheme;													-- return scheme only making domain nil which will cause an error message&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			if not scheme:match (&#039;^news:&#039;) then									-- except for news:..., MediaWiki won&#039;t link URLs that do not have authority indicator; TODO: a better way to do this test?&lt;br /&gt;
				return scheme;													-- return scheme only making domain nil which will cause an error message&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		domain = domain:gsub (&#039;(%a):%d+&#039;, &#039;%1&#039;);								-- strip port number if present&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return scheme, domain;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; L I N K _ P A R A M _ O K &amp;gt;---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs&lt;br /&gt;
&lt;br /&gt;
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:&lt;br /&gt;
	# &amp;lt; &amp;gt; [ ] | { } _&lt;br /&gt;
except the underscore which is used as a space in wiki URLs and # which is used for section links&lt;br /&gt;
&lt;br /&gt;
returns false when the value contains any of these characters.&lt;br /&gt;
&lt;br /&gt;
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the&lt;br /&gt;
|&amp;lt;param&amp;gt;-link= parameter is ok); else false when value appears to be a valid URL (the |&amp;lt;param&amp;gt;-link= parameter is NOT ok).&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function link_param_ok (value)&lt;br /&gt;
	local scheme, domain;&lt;br /&gt;
	if value:find (&#039;[&amp;lt;&amp;gt;%[%]|{}]&#039;) then                                          -- if any prohibited characters&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	scheme, domain = split_url (value);											-- get scheme or nil and domain or nil from URL; &lt;br /&gt;
	return not is_url (scheme, domain);											-- return true if value DOES NOT appear to be a valid URL&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; L I N K _ T I T L E _ O K &amp;gt;---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Use link_param_ok() to validate |&amp;lt;param&amp;gt;-link= value and its matching |&amp;lt;title&amp;gt;= value.&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;title&amp;gt;= may be wiki-linked but not when |&amp;lt;param&amp;gt;-link= has a value.  This function emits an error message when&lt;br /&gt;
that condition exists&lt;br /&gt;
&lt;br /&gt;
check &amp;lt;link&amp;gt; for inter-language interwiki-link prefix.  prefix must be a MediaWiki-recognized language&lt;br /&gt;
code and must begin with a colon.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function link_title_ok (link, lorig, title, torig)&lt;br /&gt;
	local orig;&lt;br /&gt;
	if utilities.is_set (link) then 											-- don&#039;t bother if &amp;lt;param&amp;gt;-link doesn&#039;t have a value&lt;br /&gt;
		if not link_param_ok (link) then										-- check |&amp;lt;param&amp;gt;-link= markup&lt;br /&gt;
			orig = lorig;														-- identify the failing link parameter&lt;br /&gt;
		elseif title:find (&#039;%[%[&#039;) then											-- check |title= for wikilink markup&lt;br /&gt;
			orig = torig;														-- identify the failing |title= parameter&lt;br /&gt;
		elseif link:match (&#039;^%a+:&#039;) then										-- if the link is what looks like an interwiki&lt;br /&gt;
			local prefix = link:match (&#039;^(%a+):&#039;):lower();						-- get the interwiki prefix&lt;br /&gt;
&lt;br /&gt;
			if cfg.inter_wiki_map[prefix] then									-- if prefix is in the map, must have preceding colon&lt;br /&gt;
				orig = lorig;													-- flag as error&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (orig) then&lt;br /&gt;
		link = &#039;&#039;;																-- unset&lt;br /&gt;
		utilities.set_message (&#039;err_bad_paramlink&#039;, orig);						-- URL or wikilink in |title= with |title-link=;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return link;																-- link if ok, empty string else&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C H E C K _ U R L &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Determines whether a URL string appears to be valid.&lt;br /&gt;
&lt;br /&gt;
First we test for space characters.  If any are found, return false.  Then split the URL into scheme and domain&lt;br /&gt;
portions, or for protocol-relative (//example.com) URLs, just the domain.  Use is_url() to validate the two&lt;br /&gt;
portions of the URL.  If both are valid, or for protocol-relative if domain is valid, return true, else false.&lt;br /&gt;
&lt;br /&gt;
Because it is different from a standard URL, and because this module used external_link() to make external links&lt;br /&gt;
that work for standard and news: links, we validate newsgroup names here.  The specification for a newsgroup name&lt;br /&gt;
is at https://tools.ietf.org/html/rfc5536#section-3.1.4&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function check_url( url_str )&lt;br /&gt;
	if nil == url_str:match (&amp;quot;^%S+$&amp;quot;) then										-- if there are any spaces in |url=value it can&#039;t be a proper URL&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
	local scheme, domain;&lt;br /&gt;
&lt;br /&gt;
	scheme, domain = split_url (url_str);										-- get scheme or nil and domain or nil from URL;&lt;br /&gt;
	&lt;br /&gt;
	if &#039;news:&#039; == scheme then													-- special case for newsgroups&lt;br /&gt;
		return domain:match(&#039;^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$&#039;);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return is_url (scheme, domain);												-- return true if value appears to be a valid URL&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; I S _ P A R A M E T E R _ E X T _ W I K I L I N K &amp;gt;----------------------------&lt;br /&gt;
&lt;br /&gt;
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first&lt;br /&gt;
non-space characters following the opening bracket appear to be a URL.  The test will also find external wikilinks&lt;br /&gt;
that use protocol-relative URLs. Also finds bare URLs.&lt;br /&gt;
&lt;br /&gt;
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs.  The tests that&lt;br /&gt;
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,&lt;br /&gt;
and |publisher=) may have wikilinks and there are articles or redirects like &#039;//Hus&#039; so, while uncommon, |title=[[//Hus]]&lt;br /&gt;
is possible as might be [[en://Hus]].&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function is_parameter_ext_wikilink (value)&lt;br /&gt;
local scheme, domain;&lt;br /&gt;
&lt;br /&gt;
	if value:match (&#039;%f[%[]%[%a%S*:%S+.*%]&#039;) then								-- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]&lt;br /&gt;
		scheme, domain = split_url (value:match (&#039;%f[%[]%[(%a%S*:%S+).*%]&#039;));&lt;br /&gt;
	elseif value:match (&#039;%f[%[]%[//%S+.*%]&#039;) then								-- if protocol-relative ext. wikilink: [//yyyyy.zzz]&lt;br /&gt;
		scheme, domain = split_url (value:match (&#039;%f[%[]%[(//%S+).*%]&#039;));&lt;br /&gt;
	elseif value:match (&#039;%a%S*:%S+&#039;) then										-- if bare URL with scheme; may have leading or trailing plain text&lt;br /&gt;
		scheme, domain = split_url (value:match (&#039;(%a%S*:%S+)&#039;));&lt;br /&gt;
	elseif value:match (&#039;^//%S+&#039;) or value:match (&#039;%s//%S+&#039;) then				-- if protocol-relative bare URL: //yyyyy.zzz; authority indicator (//) must be be preceded nothing or by whitespace&lt;br /&gt;
		scheme, domain = split_url (value:match (&#039;(//%S+)&#039;));					-- what is left should be the domain&lt;br /&gt;
	else&lt;br /&gt;
		return false;															-- didn&#039;t find anything that is obviously a URL&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return is_url (scheme, domain);												-- return true if value appears to be a valid URL&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-------------------------&amp;lt; C H E C K _ F O R _ U R L &amp;gt;-----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
loop through a list of parameters and their values.  Look at the value and if it has an external link, emit an error message.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function check_for_url (parameter_list, error_list)&lt;br /&gt;
	for k, v in pairs (parameter_list) do										-- for each parameter in the list&lt;br /&gt;
		if is_parameter_ext_wikilink (v) then									-- look at the value; if there is a URL add an error message&lt;br /&gt;
			table.insert (error_list, utilities.wrap_style (&#039;parameter&#039;, k));&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S A F E _ F O R _ U R L &amp;gt;------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Escape sequences for content that will be used for URL descriptions&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function safe_for_url( str )&lt;br /&gt;
	if str:match( &amp;quot;%[%[.-%]%]&amp;quot; ) ~= nil then &lt;br /&gt;
		utilities.set_message (&#039;err_wikilink_in_url&#039;, {});&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return str:gsub( &#039;[%[%]\n]&#039;, {	&lt;br /&gt;
		[&#039;[&#039;] = &#039;&amp;amp;#91;&#039;,&lt;br /&gt;
		[&#039;]&#039;] = &#039;&amp;amp;#93;&#039;,&lt;br /&gt;
		[&#039;\n&#039;] = &#039; &#039; } );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X T E R N A L _ L I N K &amp;gt;----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Format an external link with error checking&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function external_link (URL, label, source, access)&lt;br /&gt;
	local err_msg = &#039;&#039;;&lt;br /&gt;
	local domain;&lt;br /&gt;
	local path;&lt;br /&gt;
	local base_url;&lt;br /&gt;
&lt;br /&gt;
	if not utilities.is_set (label) then&lt;br /&gt;
		label = URL;&lt;br /&gt;
		if utilities.is_set (source) then&lt;br /&gt;
			utilities.set_message (&#039;err_bare_url_missing_title&#039;, {utilities.wrap_style (&#039;parameter&#039;, source)});&lt;br /&gt;
		else&lt;br /&gt;
			error (cfg.messages[&amp;quot;bare_url_no_origin&amp;quot;]);							-- programmer error; valid parameter name does not have matching meta-parameter&lt;br /&gt;
		end			&lt;br /&gt;
	end&lt;br /&gt;
	if not check_url (URL) then&lt;br /&gt;
		utilities.set_message (&#039;err_bad_url&#039;, {utilities.wrap_style (&#039;parameter&#039;, source)});&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	domain, path = URL:match (&#039;^([/%.%-%+:%a%d]+)([/%?#].*)$&#039;);					-- split the URL into scheme plus domain and path&lt;br /&gt;
	if path then																-- if there is a path portion&lt;br /&gt;
		path = path:gsub (&#039;[%[%]]&#039;, {[&#039;[&#039;] = &#039;%5b&#039;, [&#039;]&#039;] = &#039;%5d&#039;});			-- replace &#039;[&#039; and &#039;]&#039; with their percent-encoded values&lt;br /&gt;
		URL = table.concat ({domain, path});									-- and reassemble&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	base_url = table.concat ({ &amp;quot;[&amp;quot;, URL, &amp;quot; &amp;quot;, safe_for_url (label), &amp;quot;]&amp;quot; });		-- assemble a wiki-markup URL&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (access) then											-- access level (subscription, registration, limited)&lt;br /&gt;
		base_url = utilities.substitute (cfg.presentation[&#039;ext-link-access-signal&#039;], {cfg.presentation[access].class, cfg.presentation[access].title, base_url});	-- add the appropriate icon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return base_url;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; D E P R E C A T E D _ P A R A M E T E R &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
Categorize and emit an error message when the citation contains one or more deprecated parameters.  The function includes the&lt;br /&gt;
offending parameter name to the error message.  Only one error message is emitted regardless of the number of deprecated&lt;br /&gt;
parameters in the citation.&lt;br /&gt;
&lt;br /&gt;
added_deprecated_cat is a Boolean declared in page scope variables above&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function deprecated_parameter(name)&lt;br /&gt;
	if not added_deprecated_cat then&lt;br /&gt;
		added_deprecated_cat = true;											-- note that we&#039;ve added this category&lt;br /&gt;
		utilities.set_message (&#039;err_deprecated_params&#039;, {name});				-- add error message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; K E R N _ Q U O T E S &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote&lt;br /&gt;
mark contained in a |title= or |chapter= parameter&#039;s value.&lt;br /&gt;
&lt;br /&gt;
This function will positive kern either single or double quotes:&lt;br /&gt;
	&amp;quot;&#039;Unkerned title with leading and trailing single quote marks&#039;&amp;quot;&lt;br /&gt;
	&amp;quot; &#039;Kerned title with leading and trailing single quote marks&#039; &amp;quot; (in real life the kerning isn&#039;t as wide as this example)&lt;br /&gt;
Double single quotes (italic or bold wiki-markup) are not kerned.&lt;br /&gt;
&lt;br /&gt;
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter&lt;br /&gt;
quote marks regardless of the need for kerning.  Unicode quote marks are not replaced in simple [[D]] wikilinks.&lt;br /&gt;
&lt;br /&gt;
Call this function for chapter titles, for website titles, etc.; not for book titles.&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function kern_quotes (str)&lt;br /&gt;
	local cap = &#039;&#039;;&lt;br /&gt;
	local wl_type, label, link;&lt;br /&gt;
&lt;br /&gt;
	wl_type, label, link = utilities.is_wikilink (str);							-- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]&lt;br /&gt;
	&lt;br /&gt;
	if 1 == wl_type then														-- [[D]] simple wikilink with or without quote marks&lt;br /&gt;
		if mw.ustring.match (str, &#039;%[%[[\&amp;quot;“”\&#039;‘’].+[\&amp;quot;“”\&#039;‘’]%]%]&#039;) then		-- leading and trailing quote marks&lt;br /&gt;
			str = utilities.substitute (cfg.presentation[&#039;kern-left&#039;], str);&lt;br /&gt;
			str = utilities.substitute (cfg.presentation[&#039;kern-right&#039;], str);&lt;br /&gt;
		elseif mw.ustring.match (str, &#039;%[%[[\&amp;quot;“”\&#039;‘’].+%]%]&#039;)	then			-- leading quote marks&lt;br /&gt;
			str = utilities.substitute (cfg.presentation[&#039;kern-left&#039;], str);&lt;br /&gt;
		elseif mw.ustring.match (str, &#039;%[%[.+[\&amp;quot;“”\&#039;‘’]%]%]&#039;) then				-- trailing quote marks&lt;br /&gt;
			str = utilities.substitute (cfg.presentation[&#039;kern-right&#039;], str);&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	else																		-- plain text or [[L|D]]; text in label variable&lt;br /&gt;
		label = mw.ustring.gsub (label, &#039;[“”]&#039;, &#039;\&amp;quot;&#039;);							-- replace “” (U+201C &amp;amp; U+201D) with &amp;quot; (typewriter double quote mark)&lt;br /&gt;
		label = mw.ustring.gsub (label, &#039;[‘’]&#039;, &#039;\&#039;&#039;);							-- replace ‘’ (U+2018 &amp;amp; U+2019) with &#039; (typewriter single quote mark)&lt;br /&gt;
&lt;br /&gt;
		cap = mw.ustring.match (label, &amp;quot;^([\&amp;quot;\&#039;][^\&#039;].+)&amp;quot;);						-- match leading double or single quote but not doubled single quotes (italic markup)&lt;br /&gt;
		if utilities.is_set (cap) then&lt;br /&gt;
			label = utilities.substitute (cfg.presentation[&#039;kern-left&#039;], cap);&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
		cap = mw.ustring.match (label, &amp;quot;^(.+[^\&#039;][\&amp;quot;\&#039;])$&amp;quot;)						-- match trailing double or single quote but not doubled single quotes (italic markup)&lt;br /&gt;
		if utilities.is_set (cap) then&lt;br /&gt;
			label = utilities.substitute (cfg.presentation[&#039;kern-right&#039;], cap);&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if 2 == wl_type then&lt;br /&gt;
			str = utilities.make_wikilink (link, label);						-- reassemble the wikilink&lt;br /&gt;
		else&lt;br /&gt;
			str = label;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return str;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; F O R M A T _ S C R I P T _ V A L U E &amp;gt;----------------------------------------&lt;br /&gt;
&lt;br /&gt;
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should&lt;br /&gt;
not be italicized and may be written right-to-left.  The value supplied by |script-title= is concatenated onto Title after Title has been wrapped&lt;br /&gt;
in italic markup.&lt;br /&gt;
&lt;br /&gt;
Regardless of language, all values provided by |script-title= are wrapped in &amp;lt;bdi&amp;gt;...&amp;lt;/bdi&amp;gt; tags to isolate RTL languages from the English left to right.&lt;br /&gt;
&lt;br /&gt;
|script-title= provides a unique feature.  The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:&lt;br /&gt;
	|script-title=ja:*** *** (where * represents a Japanese character)&lt;br /&gt;
Spaces between the two-character code and the colon and the colon and the first script character are allowed:&lt;br /&gt;
	|script-title=ja : *** ***&lt;br /&gt;
	|script-title=ja: *** ***&lt;br /&gt;
	|script-title=ja :*** ***&lt;br /&gt;
Spaces preceding the prefix are allowed: |script-title = ja:*** ***&lt;br /&gt;
&lt;br /&gt;
The prefix is checked for validity.  If it is a valid ISO 639-1 language code, the lang attribute (lang=&amp;quot;ja&amp;quot;) is added to the &amp;lt;bdi&amp;gt; tag so that browsers can&lt;br /&gt;
know the language the tag contains.  This may help the browser render the script more correctly.  If the prefix is invalid, the lang attribute&lt;br /&gt;
is not added.  At this time there is no error message for this condition.&lt;br /&gt;
&lt;br /&gt;
Supports |script-title=, |script-chapter=, |script-&amp;lt;periodical&amp;gt;=&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function format_script_value (script_value, script_param)&lt;br /&gt;
	local lang=&#039;&#039;;																-- initialize to empty string&lt;br /&gt;
	local name;&lt;br /&gt;
	if script_value:match(&#039;^%l%l%l?%s*:&#039;) then									-- if first 3 or 4 non-space characters are script language prefix&lt;br /&gt;
		lang = script_value:match(&#039;^(%l%l%l?)%s*:%s*%S.*&#039;);						-- get the language prefix or nil if there is no script&lt;br /&gt;
		if not utilities.is_set (lang) then&lt;br /&gt;
			utilities.set_message (&#039;err_script_parameter&#039;, {script_param, cfg.err_msg_supl[&#039;missing title part&#039;]});		-- prefix without &#039;title&#039;; add error message&lt;br /&gt;
			return &#039;&#039;;															-- script_value was just the prefix so return empty string&lt;br /&gt;
		end&lt;br /&gt;
																				-- if we get this far we have prefix and script&lt;br /&gt;
		name = cfg.lang_tag_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code );	-- get language name so that we can use it to categorize&lt;br /&gt;
		if utilities.is_set (name) then											-- is prefix a proper ISO 639-1 language code?&lt;br /&gt;
			script_value = script_value:gsub (&#039;^%l+%s*:%s*&#039;, &#039;&#039;);				-- strip prefix from script&lt;br /&gt;
																				-- is prefix one of these language codes?&lt;br /&gt;
			if utilities.in_array (lang, cfg.script_lang_codes) then&lt;br /&gt;
				utilities.add_prop_cat (&#039;script&#039;, {name, lang})&lt;br /&gt;
			else&lt;br /&gt;
				utilities.set_message (&#039;err_script_parameter&#039;, {script_param, cfg.err_msg_supl[&#039;unknown language code&#039;]});	-- unknown script-language; add error message&lt;br /&gt;
			end&lt;br /&gt;
			lang = &#039; lang=&amp;quot;&#039; .. lang .. &#039;&amp;quot; &#039;;									-- convert prefix into a lang attribute&lt;br /&gt;
		else&lt;br /&gt;
			utilities.set_message (&#039;err_script_parameter&#039;, {script_param, cfg.err_msg_supl[&#039;invalid language code&#039;]});		-- invalid language code; add error message&lt;br /&gt;
			lang = &#039;&#039;;															-- invalid so set lang to empty string&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		utilities.set_message (&#039;err_script_parameter&#039;, {script_param, cfg.err_msg_supl[&#039;missing prefix&#039;]});				-- no language code prefix; add error message&lt;br /&gt;
	end&lt;br /&gt;
	script_value = utilities.substitute (cfg.presentation[&#039;bdi&#039;], {lang, script_value});	-- isolate in case script is RTL&lt;br /&gt;
&lt;br /&gt;
	return script_value;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S C R I P T _ C O N C A T E N A T E &amp;gt;------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script&lt;br /&gt;
value has been wrapped in &amp;lt;bdi&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function script_concatenate (title, script, script_param)&lt;br /&gt;
	if utilities.is_set (script) then&lt;br /&gt;
		script = format_script_value (script, script_param);					-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; returns empty string on error&lt;br /&gt;
		if utilities.is_set (script) then&lt;br /&gt;
			title = title .. &#039; &#039; .. script;										-- concatenate title and script title&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return title;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; W R A P _ M S G &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list&lt;br /&gt;
configuration taking one argument.  Supports lower case text for {{citation}} templates.  Additional text taken&lt;br /&gt;
from citation_config.messages - the reason this function is similar to but separate from wrap_style().&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function wrap_msg (key, str, lower)&lt;br /&gt;
	if not utilities.is_set ( str ) then&lt;br /&gt;
		return &amp;quot;&amp;quot;;&lt;br /&gt;
	end&lt;br /&gt;
	if true == lower then&lt;br /&gt;
		local msg;&lt;br /&gt;
		msg = cfg.messages[key]:lower();										-- set the message to lower case before &lt;br /&gt;
		return utilities.substitute ( msg, str );								-- including template text&lt;br /&gt;
	else&lt;br /&gt;
		return utilities.substitute ( cfg.messages[key], str );&lt;br /&gt;
	end		&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------&amp;lt; W I K I S O U R C E _ U R L _ M A K E &amp;gt;-------------------&lt;br /&gt;
&lt;br /&gt;
Makes a Wikisource URL from Wikisource interwiki-link.  Returns the URL and appropriate&lt;br /&gt;
label; nil else.&lt;br /&gt;
&lt;br /&gt;
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function wikisource_url_make (str)&lt;br /&gt;
	local wl_type, D, L;&lt;br /&gt;
	local ws_url, ws_label;&lt;br /&gt;
	local wikisource_prefix = table.concat ({&#039;https://&#039;, cfg.this_wiki_code, &#039;.wikisource.org/wiki/&#039;});&lt;br /&gt;
&lt;br /&gt;
	wl_type, D, L = utilities.is_wikilink (str);								-- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)&lt;br /&gt;
&lt;br /&gt;
	if 0 == wl_type then														-- not a wikilink; might be from |title-link=&lt;br /&gt;
		str = D:match (&#039;^[Ww]ikisource:(.+)&#039;) or D:match (&#039;^[Ss]:(.+)&#039;);		-- article title from interwiki link with long-form or short-form namespace&lt;br /&gt;
		if utilities.is_set (str) then&lt;br /&gt;
			ws_url = table.concat ({											-- build a Wikisource URL&lt;br /&gt;
				wikisource_prefix,												-- prefix&lt;br /&gt;
				str,															-- article title&lt;br /&gt;
				});&lt;br /&gt;
			ws_label = str;														-- label for the URL&lt;br /&gt;
		end&lt;br /&gt;
	elseif 1 == wl_type then													-- simple wikilink: [[Wikisource:ws article]]&lt;br /&gt;
		str = D:match (&#039;^[Ww]ikisource:(.+)&#039;) or D:match (&#039;^[Ss]:(.+)&#039;);		-- article title from interwiki link with long-form or short-form namespace&lt;br /&gt;
		if utilities.is_set (str) then&lt;br /&gt;
			ws_url = table.concat ({											-- build a Wikisource URL&lt;br /&gt;
				wikisource_prefix,												-- prefix&lt;br /&gt;
				str,															-- article title&lt;br /&gt;
				});&lt;br /&gt;
			ws_label = str;														-- label for the URL&lt;br /&gt;
		end&lt;br /&gt;
	elseif 2 == wl_type then													-- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])&lt;br /&gt;
		str = L:match (&#039;^[Ww]ikisource:(.+)&#039;) or L:match (&#039;^[Ss]:(.+)&#039;);		-- article title from interwiki link with long-form or short-form namespace&lt;br /&gt;
		if utilities.is_set (str) then&lt;br /&gt;
			ws_label = D;														-- get ws article name from display portion of interwiki link&lt;br /&gt;
			ws_url = table.concat ({											-- build a Wikisource URL&lt;br /&gt;
				wikisource_prefix,												-- prefix&lt;br /&gt;
				str,															-- article title without namespace from link portion of wikilink&lt;br /&gt;
				});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if ws_url then&lt;br /&gt;
		ws_url = mw.uri.encode (ws_url, &#039;WIKI&#039;);								-- make a usable URL&lt;br /&gt;
		ws_url = ws_url:gsub (&#039;%%23&#039;, &#039;#&#039;);										-- undo percent-encoding of fragment marker&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ws_url, ws_label, L or D;											-- return proper URL or nil and a label or nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------&amp;lt; F O R M A T _ P E R I O D I C A L &amp;gt;-----------------------&lt;br /&gt;
&lt;br /&gt;
Format the three periodical parameters: |script-&amp;lt;periodical&amp;gt;=, |&amp;lt;periodical&amp;gt;=,&lt;br /&gt;
and |trans-&amp;lt;periodical&amp;gt;= into a single Periodical meta-parameter.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)&lt;br /&gt;
&lt;br /&gt;
	if not utilities.is_set (periodical) then&lt;br /&gt;
		periodical = &#039;&#039;;														-- to be safe for concatenation&lt;br /&gt;
	else&lt;br /&gt;
		periodical = utilities.wrap_style (&#039;italic-title&#039;, periodical);			-- style &lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	periodical = script_concatenate (periodical, script_periodical, script_periodical_source);	-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; must be done after title is wrapped&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (trans_periodical) then&lt;br /&gt;
		trans_periodical = utilities.wrap_style (&#039;trans-italic-title&#039;, trans_periodical);&lt;br /&gt;
		if utilities.is_set (periodical) then&lt;br /&gt;
			periodical = periodical .. &#039; &#039; .. trans_periodical;&lt;br /&gt;
		else																	-- here when trans-periodical without periodical or script-periodical&lt;br /&gt;
			periodical = trans_periodical;&lt;br /&gt;
			utilities.set_message (&#039;err_trans_missing_title&#039;, {&#039;periodical&#039;});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return periodical;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[------------------&amp;lt; F O R M A T _ C H A P T E R _ T I T L E &amp;gt;---------------&lt;br /&gt;
&lt;br /&gt;
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,&lt;br /&gt;
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used&lt;br /&gt;
for error messages).&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)&lt;br /&gt;
	local ws_url, ws_label, L = wikisource_url_make (chapter);					-- make a wikisource URL and label from a wikisource interwiki link&lt;br /&gt;
	if ws_url then&lt;br /&gt;
		ws_label = ws_label:gsub (&#039;_&#039;, &#039; &#039;);									-- replace underscore separators with space characters&lt;br /&gt;
		chapter = ws_label;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not utilities.is_set (chapter) then&lt;br /&gt;
		chapter = &#039;&#039;;															-- to be safe for concatenation&lt;br /&gt;
	else&lt;br /&gt;
		if false == no_quotes then&lt;br /&gt;
			chapter = kern_quotes (chapter);									-- if necessary, separate chapter title&#039;s leading and trailing quote marks from module provided quote marks&lt;br /&gt;
			chapter = utilities.wrap_style (&#039;quoted-title&#039;, chapter);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	chapter = script_concatenate (chapter, script_chapter, script_chapter_source);	-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; must be done after title is wrapped&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (chapter_url) then&lt;br /&gt;
		chapter = external_link (chapter_url, chapter, chapter_url_source, access);	-- adds bare_url_missing_title error if appropriate&lt;br /&gt;
	elseif ws_url then&lt;br /&gt;
		chapter = external_link (ws_url, chapter .. &#039;&amp;amp;nbsp;&#039;, &#039;ws link in chapter&#039;);	-- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?&lt;br /&gt;
		chapter = utilities.substitute (cfg.presentation[&#039;interwiki-icon&#039;], {cfg.presentation[&#039;class-wikisource&#039;], L, chapter});				&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (trans_chapter) then&lt;br /&gt;
		trans_chapter = utilities.wrap_style (&#039;trans-quoted-title&#039;, trans_chapter);&lt;br /&gt;
		if utilities.is_set (chapter) then&lt;br /&gt;
			chapter = chapter .. &#039; &#039; .. trans_chapter;&lt;br /&gt;
		else																	-- here when trans_chapter without chapter or script-chapter&lt;br /&gt;
			chapter = trans_chapter;&lt;br /&gt;
			chapter_source = trans_chapter_source:match (&#039;trans%-?(.+)&#039;);		-- when no chapter, get matching name from trans-&amp;lt;param&amp;gt;&lt;br /&gt;
			utilities.set_message (&#039;err_trans_missing_title&#039;, {chapter_source});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return chapter;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------&amp;lt; H A S _ I N V I S I B L E _ C H A R S &amp;gt;-------------------&lt;br /&gt;
&lt;br /&gt;
This function searches a parameter&#039;s value for non-printable or invisible characters.&lt;br /&gt;
The search stops at the first match.&lt;br /&gt;
&lt;br /&gt;
This function will detect the visible replacement character when it is part of the Wikisource.&lt;br /&gt;
&lt;br /&gt;
Detects but ignores nowiki and math stripmarkers.  Also detects other named stripmarkers&lt;br /&gt;
(gallery, math, pre, ref) and identifies them with a slightly different error message.&lt;br /&gt;
See also coins_cleanup().&lt;br /&gt;
&lt;br /&gt;
Output of this function is an error message that identifies the character or the&lt;br /&gt;
Unicode group, or the stripmarker that was detected along with its position (or,&lt;br /&gt;
for multi-byte characters, the position of its first byte) in the parameter value.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function has_invisible_chars (param, v)&lt;br /&gt;
	local position = &#039;&#039;;														-- position of invisible char or starting position of stripmarker&lt;br /&gt;
	local capture;																-- used by stripmarker detection to hold name of the stripmarker&lt;br /&gt;
	local stripmarker;															-- boolean set true when a stripmarker is found&lt;br /&gt;
&lt;br /&gt;
	capture = string.match (v, &#039;[%w%p ]*&#039;);										-- test for values that are simple ASCII text and bypass other tests if true&lt;br /&gt;
	if capture == v then														-- if same there are no Unicode characters&lt;br /&gt;
		return;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for _, invisible_char in ipairs (cfg.invisible_chars) do&lt;br /&gt;
		local char_name = invisible_char[1];									-- the character or group name&lt;br /&gt;
		local pattern = invisible_char[2];										-- the pattern used to find it&lt;br /&gt;
		position, _, capture = mw.ustring.find (v, pattern);					-- see if the parameter value contains characters that match the pattern&lt;br /&gt;
		&lt;br /&gt;
		if position and (cfg.invisible_defs.zwj == capture) then				-- if we found a zero-width joiner character&lt;br /&gt;
			if mw.ustring.find (v, cfg.indic_script) then						-- it&#039;s ok if one of the Indic scripts&lt;br /&gt;
				position = nil;													-- unset position&lt;br /&gt;
			elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then			-- is zwj followed by a character listed in emoji{}?&lt;br /&gt;
				position = nil;													-- unset position&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if position then&lt;br /&gt;
			if &#039;nowiki&#039; == capture or &#039;math&#039; == capture or						-- nowiki and math stripmarkers (not an error condition)&lt;br /&gt;
				(&#039;templatestyles&#039; == capture and utilities.in_array (param, {&#039;id&#039;, &#039;quote&#039;})) then	-- templatestyles stripmarker allowed in these parameters&lt;br /&gt;
					stripmarker = true;											-- set a flag&lt;br /&gt;
			elseif true == stripmarker and cfg.invisible_defs.del == capture then	-- because stripmakers begin and end with the delete char, assume that we&#039;ve found one end of a stripmarker&lt;br /&gt;
				position = nil;													-- unset&lt;br /&gt;
			else&lt;br /&gt;
				local err_msg;&lt;br /&gt;
				if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then&lt;br /&gt;
					err_msg = capture .. &#039; &#039; .. char_name;&lt;br /&gt;
				else&lt;br /&gt;
					err_msg = char_name .. &#039; &#039; .. &#039;character&#039;;&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				utilities.set_message (&#039;err_invisible_char&#039;, {err_msg, utilities.wrap_style (&#039;parameter&#039;, param), position});	-- add error message&lt;br /&gt;
				return;															-- and done with this parameter&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-------------------&amp;lt; A R G U M E N T _ W R A P P E R &amp;gt;----------------------&lt;br /&gt;
&lt;br /&gt;
Argument wrapper.  This function provides support for argument mapping defined&lt;br /&gt;
in the configuration file so that multiple names can be transparently aliased to&lt;br /&gt;
single internal variable.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function argument_wrapper ( args )&lt;br /&gt;
	local origin = {};&lt;br /&gt;
	&lt;br /&gt;
	return setmetatable({&lt;br /&gt;
		ORIGIN = function ( self, k )&lt;br /&gt;
			local dummy = self[k];												-- force the variable to be loaded.&lt;br /&gt;
			return origin[k];&lt;br /&gt;
		end&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		__index = function ( tbl, k )&lt;br /&gt;
			if origin[k] ~= nil then&lt;br /&gt;
				return nil;&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			local args, list, v = args, cfg.aliases[k];&lt;br /&gt;
			&lt;br /&gt;
			if type( list ) == &#039;table&#039; then&lt;br /&gt;
				v, origin[k] = utilities.select_one ( args, list, &#039;err_redundant_parameters&#039; );&lt;br /&gt;
				if origin[k] == nil then&lt;br /&gt;
					origin[k] = &#039;&#039;;												-- Empty string, not nil&lt;br /&gt;
				end&lt;br /&gt;
			elseif list ~= nil then&lt;br /&gt;
				v, origin[k] = args[list], list;&lt;br /&gt;
			else&lt;br /&gt;
				-- maybe let through instead of raising an error?&lt;br /&gt;
				-- v, origin[k] = args[k], k;&lt;br /&gt;
				error( cfg.messages[&#039;unknown_argument_map&#039;] .. &#039;: &#039; .. k);&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			-- Empty strings, not nil;&lt;br /&gt;
			if v == nil then&lt;br /&gt;
				v = &#039;&#039;;&lt;br /&gt;
				origin[k] = &#039;&#039;;&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			tbl = rawset( tbl, k, v );&lt;br /&gt;
			return v;&lt;br /&gt;
		end,&lt;br /&gt;
	});&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; N O W R A P _ D A T E &amp;gt;-------------------------&lt;br /&gt;
&lt;br /&gt;
When date is YYYY-MM-DD format wrap in nowrap span: &amp;lt;span ...&amp;gt;YYYY-MM-DD&amp;lt;/span&amp;gt;.&lt;br /&gt;
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:&lt;br /&gt;
&amp;lt;span ...&amp;gt;DD MMMM&amp;lt;/span&amp;gt; YYYY or &amp;lt;span ...&amp;gt;MMMM DD,&amp;lt;/span&amp;gt; YYYY&lt;br /&gt;
&lt;br /&gt;
DOES NOT yet support MMMM YYYY or any of the date ranges.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function nowrap_date (date)&lt;br /&gt;
	local cap = &#039;&#039;;&lt;br /&gt;
	local cap2 = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
	if date:match(&amp;quot;^%d%d%d%d%-%d%d%-%d%d$&amp;quot;) then&lt;br /&gt;
		date = utilities.substitute (cfg.presentation[&#039;nowrap1&#039;], date);&lt;br /&gt;
	&lt;br /&gt;
	elseif date:match(&amp;quot;^%a+%s*%d%d?,%s+%d%d%d%d$&amp;quot;) or date:match (&amp;quot;^%d%d?%s*%a+%s+%d%d%d%d$&amp;quot;) then&lt;br /&gt;
		cap, cap2 = string.match (date, &amp;quot;^(.*)%s+(%d%d%d%d)$&amp;quot;);&lt;br /&gt;
		date = utilities.substitute (cfg.presentation[&#039;nowrap2&#039;], {cap, cap2});&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return date;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S E T _ T I T L E T Y P E &amp;gt;---------------------&lt;br /&gt;
&lt;br /&gt;
This function sets default title types (equivalent to the citation including&lt;br /&gt;
|type=&amp;lt;default value&amp;gt;) for those templates that have defaults. Also handles the&lt;br /&gt;
special case where it is desirable to omit the title type from the rendered citation&lt;br /&gt;
(|type=none).&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function set_titletype (cite_class, title_type)&lt;br /&gt;
	if utilities.is_set (title_type) then&lt;br /&gt;
		if &#039;none&#039; == cfg.keywords_xlate[title_type] then&lt;br /&gt;
			title_type = &#039;&#039;;													-- if |type=none then type parameter not displayed&lt;br /&gt;
		end&lt;br /&gt;
		return title_type;														-- if |type= has been set to any other value use that value&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return cfg.title_types [cite_class] or &#039;&#039;;									-- set template&#039;s default title type; else empty string for concatenation&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S A F E _ J O I N &amp;gt;-----------------------------&lt;br /&gt;
&lt;br /&gt;
Joins a sequence of strings together while checking for duplicate separation characters.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function safe_join( tbl, duplicate_char )&lt;br /&gt;
	local f = {};																-- create a function table appropriate to type of &#039;duplicate character&#039;&lt;br /&gt;
		if 1 == #duplicate_char then											-- for single byte ASCII characters use the string library functions&lt;br /&gt;
			f.gsub = string.gsub&lt;br /&gt;
			f.match = string.match&lt;br /&gt;
			f.sub = string.sub&lt;br /&gt;
		else																	-- for multi-byte characters use the ustring library functions&lt;br /&gt;
			f.gsub = mw.ustring.gsub&lt;br /&gt;
			f.match = mw.ustring.match&lt;br /&gt;
			f.sub = mw.ustring.sub&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	local str = &#039;&#039;;																-- the output string&lt;br /&gt;
	local comp = &#039;&#039;;															-- what does &#039;comp&#039; mean?&lt;br /&gt;
	local end_chr = &#039;&#039;;&lt;br /&gt;
	local trim;&lt;br /&gt;
	for _, value in ipairs( tbl ) do&lt;br /&gt;
		if value == nil then value = &#039;&#039;; end&lt;br /&gt;
		&lt;br /&gt;
		if str == &#039;&#039; then														-- if output string is empty&lt;br /&gt;
			str = value;														-- assign value to it (first time through the loop)&lt;br /&gt;
		elseif value ~= &#039;&#039; then&lt;br /&gt;
			if value:sub(1, 1) == &#039;&amp;lt;&#039; then										-- special case of values enclosed in spans and other markup.&lt;br /&gt;
				comp = value:gsub( &amp;quot;%b&amp;lt;&amp;gt;&amp;quot;, &amp;quot;&amp;quot; );								-- remove HTML markup (&amp;lt;span&amp;gt;string&amp;lt;/span&amp;gt; -&amp;gt; string)&lt;br /&gt;
			else&lt;br /&gt;
				comp = value;&lt;br /&gt;
			end&lt;br /&gt;
																				-- typically duplicate_char is sepc&lt;br /&gt;
			if f.sub(comp, 1, 1) == duplicate_char then							-- is first character same as duplicate_char? why test first character?&lt;br /&gt;
																				--   Because individual string segments often (always?) begin with terminal punct for the&lt;br /&gt;
																				--   preceding segment: &#039;First element&#039; .. &#039;sepc next element&#039; .. etc.?&lt;br /&gt;
				trim = false;&lt;br /&gt;
				end_chr = f.sub(str, -1, -1);									-- get the last character of the output string&lt;br /&gt;
				-- str = str .. &amp;quot;&amp;lt;HERE(enchr=&amp;quot; .. end_chr .. &amp;quot;)&amp;quot;				-- debug stuff?&lt;br /&gt;
				if end_chr == duplicate_char then								-- if same as separator&lt;br /&gt;
					str = f.sub(str, 1, -2);									-- remove it&lt;br /&gt;
				elseif end_chr == &amp;quot;&#039;&amp;quot; then										-- if it might be wiki-markup&lt;br /&gt;
					if f.sub(str, -3, -1) == duplicate_char .. &amp;quot;&#039;&#039;&amp;quot; then		-- if last three chars of str are sepc&#039;&#039; &lt;br /&gt;
						str = f.sub(str, 1, -4) .. &amp;quot;&#039;&#039;&amp;quot;;						-- remove them and add back &#039;&#039;&lt;br /&gt;
					elseif  f.sub(str, -5, -1) == duplicate_char .. &amp;quot;]]&#039;&#039;&amp;quot; then	-- if last five chars of str are sepc]]&#039;&#039; &lt;br /&gt;
						trim = true;											-- why? why do this and next differently from previous?&lt;br /&gt;
					elseif f.sub(str, -4, -1) == duplicate_char .. &amp;quot;]&#039;&#039;&amp;quot; then	-- if last four chars of str are sepc]&#039;&#039; &lt;br /&gt;
						trim = true;											-- same question&lt;br /&gt;
					end&lt;br /&gt;
				elseif end_chr == &amp;quot;]&amp;quot; then										-- if it might be wiki-markup&lt;br /&gt;
					if f.sub(str, -3, -1) == duplicate_char .. &amp;quot;]]&amp;quot; then		-- if last three chars of str are sepc]] wikilink &lt;br /&gt;
						trim = true;&lt;br /&gt;
					elseif f.sub(str, -3, -1) == duplicate_char .. &#039;&amp;quot;]&#039; then	-- if last three chars of str are sepc&amp;quot;] quoted external link &lt;br /&gt;
						trim = true;&lt;br /&gt;
					elseif  f.sub(str, -2, -1) == duplicate_char .. &amp;quot;]&amp;quot; then	-- if last two chars of str are sepc] external link&lt;br /&gt;
						trim = true;&lt;br /&gt;
					elseif f.sub(str, -4, -1) == duplicate_char .. &amp;quot;&#039;&#039;]&amp;quot; then	-- normal case when |url=something &amp;amp; |title=Title.&lt;br /&gt;
						trim = true;&lt;br /&gt;
					end&lt;br /&gt;
				elseif end_chr == &amp;quot; &amp;quot; then										-- if last char of output string is a space&lt;br /&gt;
					if f.sub(str, -2, -1) == duplicate_char .. &amp;quot; &amp;quot; then			-- if last two chars of str are &amp;lt;sepc&amp;gt;&amp;lt;space&amp;gt;&lt;br /&gt;
						str = f.sub(str, 1, -3);								-- remove them both&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				if trim then&lt;br /&gt;
					if value ~= comp then 										-- value does not equal comp when value contains HTML markup&lt;br /&gt;
						local dup2 = duplicate_char;&lt;br /&gt;
						if f.match(dup2, &amp;quot;%A&amp;quot; ) then dup2 = &amp;quot;%&amp;quot; .. dup2; end	-- if duplicate_char not a letter then escape it&lt;br /&gt;
						&lt;br /&gt;
						value = f.gsub(value, &amp;quot;(%b&amp;lt;&amp;gt;)&amp;quot; .. dup2, &amp;quot;%1&amp;quot;, 1 )		-- remove duplicate_char if it follows HTML markup&lt;br /&gt;
					else&lt;br /&gt;
						value = f.sub(value, 2, -1 );							-- remove duplicate_char when it is first character&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			str = str .. value; 												-- add it to the output string&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return str;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ S U F F I X &amp;gt;-----------------------------&lt;br /&gt;
&lt;br /&gt;
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.&lt;br /&gt;
Puncutation not allowed.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_suffix (suffix)&lt;br /&gt;
	if utilities.in_array (suffix, {&#039;Jr&#039;, &#039;Sr&#039;, &#039;Jnr&#039;, &#039;Snr&#039;, &#039;1st&#039;, &#039;2nd&#039;, &#039;3rd&#039;}) or suffix:match (&#039;^%dth$&#039;) then&lt;br /&gt;
		return true;&lt;br /&gt;
	end&lt;br /&gt;
	return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------&amp;lt; I S _ G O O D _ V A N C _ N A M E &amp;gt;-------------------&lt;br /&gt;
&lt;br /&gt;
For Vancouver style, author/editor names are supposed to be rendered in Latin&lt;br /&gt;
(read ASCII) characters.  When a name uses characters that contain diacritical&lt;br /&gt;
marks, those characters are to be converted to the corresponding Latin&lt;br /&gt;
character. When a name is written using a non-Latin alphabet or logogram, that&lt;br /&gt;
name is to be transliterated into Latin characters. The module doesn&#039;t do this&lt;br /&gt;
so editors may/must.&lt;br /&gt;
&lt;br /&gt;
This test allows |first= and |last= names to contain any of the letters defined&lt;br /&gt;
in the four Unicode Latin character sets&lt;br /&gt;
	[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A&lt;br /&gt;
	[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF&lt;br /&gt;
	[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F&lt;br /&gt;
	[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F&lt;br /&gt;
&lt;br /&gt;
|lastn= also allowed to contain hyphens, spaces, and apostrophes.&lt;br /&gt;
	(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)&lt;br /&gt;
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods&lt;br /&gt;
&lt;br /&gt;
This original test:&lt;br /&gt;
	if nil == mw.ustring.find (last, &amp;quot;^[A-Za-zÀ-ÖØ-öø-ƿǄ-ɏ%-%s%&#039;]*$&amp;quot;)&lt;br /&gt;
	or nil == mw.ustring.find (first, &amp;quot;^[A-Za-zÀ-ÖØ-öø-ƿǄ-ɏ%-%s%&#039;%.]+[2-6%a]*$&amp;quot;) then&lt;br /&gt;
was written outside of the code editor and pasted here because the code editor&lt;br /&gt;
gets confused between character insertion point and cursor position. The test has&lt;br /&gt;
been rewritten to use decimal character escape sequence for the individual bytes&lt;br /&gt;
of the Unicode characters so that it is not necessary to use an external editor&lt;br /&gt;
to maintain this code.&lt;br /&gt;
&lt;br /&gt;
	\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)&lt;br /&gt;
	\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)&lt;br /&gt;
	\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A &amp;amp; B)&lt;br /&gt;
	\199\132-\201\143 – Ǆ-ɏ (U+01C4-U+024F – Latin extended B)&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_good_vanc_name (last, first, suffix, position)&lt;br /&gt;
	if not suffix then&lt;br /&gt;
		if first:find (&#039;[,%s]&#039;) then											-- when there is a space or comma, might be first name/initials + generational suffix&lt;br /&gt;
			first = first:match (&#039;(.-)[,%s]+&#039;);									-- get name/initials&lt;br /&gt;
			suffix = first:match (&#039;[,%s]+(.+)$&#039;);								-- get generational suffix&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if utilities.is_set (suffix) then&lt;br /&gt;
		if not is_suffix (suffix) then&lt;br /&gt;
			add_vanc_error (cfg.err_msg_supl.suffix, position);&lt;br /&gt;
			return false;														-- not a name with an appropriate suffix&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if nil == mw.ustring.find (last, &amp;quot;^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%&#039;]*$&amp;quot;) or&lt;br /&gt;
		nil == mw.ustring.find (first, &amp;quot;^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%&#039;%.]*$&amp;quot;) then&lt;br /&gt;
			add_vanc_error (cfg.err_msg_supl[&#039;non-Latin char&#039;], position);&lt;br /&gt;
			return false;														-- not a string of Latin characters; Vancouver requires Romanization&lt;br /&gt;
	end;&lt;br /&gt;
	return true;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; R E D U C E _ T O _ I N I T I A L S &amp;gt;------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Attempts to convert names to initials in support of |name-list-style=vanc.  &lt;br /&gt;
&lt;br /&gt;
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.&lt;br /&gt;
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.&lt;br /&gt;
&lt;br /&gt;
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered&lt;br /&gt;
as Jr, 2nd, 3rd, etc.  See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.&lt;br /&gt;
This code only accepts and understands generational suffix in the Vancouver format&lt;br /&gt;
because Roman numerals look like, and can be mistaken for, initials.&lt;br /&gt;
&lt;br /&gt;
This function uses ustring functions because firstname initials may be any of the&lt;br /&gt;
Unicode Latin characters accepted by is_good_vanc_name ().&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function reduce_to_initials (first, position)&lt;br /&gt;
	if first:find (&#039;,&#039;, 1, true) then&lt;br /&gt;
		return first;															-- commas not allowed; abandon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local name, suffix = mw.ustring.match (first, &amp;quot;^(%u+) ([%dJS][%drndth]+)$&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	if not name then															-- if not initials and a suffix&lt;br /&gt;
		name = mw.ustring.match (first, &amp;quot;^(%u+)$&amp;quot;);								-- is it just initials?&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if name then																-- if first is initials with or without suffix&lt;br /&gt;
		if 3 &amp;gt; mw.ustring.len (name) then										-- if one or two initials&lt;br /&gt;
			if suffix then														-- if there is a suffix&lt;br /&gt;
				if is_suffix (suffix) then										-- is it legitimate?&lt;br /&gt;
					return first;												-- one or two initials and a valid suffix so nothing to do&lt;br /&gt;
				else&lt;br /&gt;
					add_vanc_error (cfg.err_msg_supl.suffix, position);			-- one or two initials with invalid suffix so error message&lt;br /&gt;
					return first;												-- and return first unmolested&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				return first;													-- one or two initials without suffix; nothing to do&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end																			-- if here then name has 3 or more uppercase letters so treat them as a word&lt;br /&gt;
&lt;br /&gt;
	local initials_t, names_t = {}, {};											-- tables to hold name parts and initials&lt;br /&gt;
	local i = 1;																-- counter for number of initials&lt;br /&gt;
&lt;br /&gt;
	names_t = mw.text.split (first, &#039;[%s%-]+&#039;);									-- split into a sequence of names and possible suffix&lt;br /&gt;
&lt;br /&gt;
	while names_t[i] do															-- loop through the sequence&lt;br /&gt;
		if 1 &amp;lt; i and names_t[i]:match (&#039;[%dJS][%drndth]+%.?$&#039;) then				-- if not the first name, and looks like a suffix (may have trailing dot)&lt;br /&gt;
			names_t[i] = names_t[i]:gsub (&#039;%.&#039;, &#039;&#039;);							-- remove terminal dot if present&lt;br /&gt;
			if is_suffix (names_t[i]) then										-- if a legitimate suffix&lt;br /&gt;
				table.insert (initials_t, &#039; &#039; .. names_t[i]);					-- add a separator space, insert at end of initials sequence&lt;br /&gt;
				break;															-- and done because suffix must fall at the end of a name&lt;br /&gt;
			end																	-- no error message if not a suffix; possibly because of Romanization&lt;br /&gt;
		end&lt;br /&gt;
		if 3 &amp;gt; i then&lt;br /&gt;
			table.insert (initials_t, mw.ustring.sub (names_t[i], 1, 1));		-- insert the initial at end of initials sequence&lt;br /&gt;
		end&lt;br /&gt;
		i = i + 1;																-- bump the counter&lt;br /&gt;
	end&lt;br /&gt;
			&lt;br /&gt;
	return table.concat (initials_t);											-- Vancouver format does not include spaces.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I N T E R W I K I _ P R E F I X E N _ G E T &amp;gt;----------------------------------&lt;br /&gt;
&lt;br /&gt;
extract interwiki prefixen from &amp;lt;value&amp;gt;.  Returns two one or two values:&lt;br /&gt;
	false – no prefixen&lt;br /&gt;
	nil – prefix exists but not recognized&lt;br /&gt;
	project prefix, language prefix – when value has either of:&lt;br /&gt;
		:&amp;lt;project&amp;gt;:&amp;lt;language&amp;gt;:&amp;lt;article&amp;gt;&lt;br /&gt;
		:&amp;lt;language&amp;gt;:&amp;lt;project&amp;gt;:&amp;lt;article&amp;gt;&lt;br /&gt;
	project prefix, nil – when &amp;lt;value&amp;gt; has only a known single-letter prefix&lt;br /&gt;
	nil, language prefix – when &amp;lt;value&amp;gt; has only a known language prefix&lt;br /&gt;
&lt;br /&gt;
accepts single-letter project prefixen: &#039;d&#039; (wikidata), &#039;s&#039; (wikisource), and &#039;w&#039; (wikipedia) prefixes; at this&lt;br /&gt;
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and&lt;br /&gt;
v (wikiversity)) are not supported.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function interwiki_prefixen_get (value, is_link)&lt;br /&gt;
	if not value:find (&#039;:%l+:&#039;) then											-- if no prefix&lt;br /&gt;
		return false;															-- abandon; boolean here to distinguish from nil fail returns later&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local prefix_patterns_linked_t = {											-- sequence of valid interwiki and inter project prefixen&lt;br /&gt;
		&#039;^%[%[:([dsw]):(%l%l+):&#039;,												-- wikilinked; project and language prefixes&lt;br /&gt;
		&#039;^%[%[:(%l%l+):([dsw]):&#039;,												-- wikilinked; language and project prefixes&lt;br /&gt;
		&#039;^%[%[:([dsw]):&#039;,														-- wikilinked; project prefix&lt;br /&gt;
		&#039;^%[%[:(%l%l+):&#039;,														-- wikilinked; language prefix&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
	local prefix_patterns_unlinked_t = {										-- sequence of valid interwiki and inter project prefixen&lt;br /&gt;
		&#039;^:([dsw]):(%l%l+):&#039;,													-- project and language prefixes&lt;br /&gt;
		&#039;^:(%l%l+):([dsw]):&#039;,													-- language and project prefixes&lt;br /&gt;
		&#039;^:([dsw]):&#039;,															-- project prefix&lt;br /&gt;
		&#039;^:(%l%l+):&#039;,															-- language prefix&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
	local cap1, cap2;&lt;br /&gt;
	for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do&lt;br /&gt;
		cap1, cap2 = value:match (pattern);&lt;br /&gt;
		if cap1 then&lt;br /&gt;
			break;																-- found a match so stop looking&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if cap1 and cap2 then														-- when both then :project:language: or :language:project: (both forms allowed)&lt;br /&gt;
		if 1 == #cap1 then														-- length == 1 then :project:language:&lt;br /&gt;
			if cfg.inter_wiki_map[cap2] then									-- is language prefix in the interwiki map?&lt;br /&gt;
				return cap1, cap2;												-- return interwiki project and interwiki language&lt;br /&gt;
			end&lt;br /&gt;
		else																	-- here when :language:project:&lt;br /&gt;
			if cfg.inter_wiki_map[cap1] then									-- is language prefix in the interwiki map?&lt;br /&gt;
				return cap2, cap1;												-- return interwiki project and interwiki language&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return nil;																-- unknown interwiki language&lt;br /&gt;
	elseif not (cap1 or cap2) then												-- both are nil?&lt;br /&gt;
		return nil;																-- we got something that looks like a project prefix but isn&#039;t; return fail&lt;br /&gt;
	elseif 1 == #cap1 then														-- here when one capture&lt;br /&gt;
		return cap1, nil;														-- length is 1 so return project, nil language&lt;br /&gt;
	else																		-- here when one capture and its length it more than 1&lt;br /&gt;
		if cfg.inter_wiki_map[cap1] then										-- is language prefix in the interwiki map?&lt;br /&gt;
			return nil, cap1;													-- return nil project, language&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; L I S T _ P E O P L E &amp;gt;--------------------------&lt;br /&gt;
&lt;br /&gt;
Formats a list of people (authors, contributors, editors, interviewers, translators) &lt;br /&gt;
&lt;br /&gt;
names in the list will be linked when&lt;br /&gt;
	|&amp;lt;name&amp;gt;-link= has a value&lt;br /&gt;
	|&amp;lt;name&amp;gt;-mask- does NOT have a value; masked names are presumed to have been&lt;br /&gt;
		rendered previously so should have been linked there&lt;br /&gt;
&lt;br /&gt;
when |&amp;lt;name&amp;gt;-mask=0, the associated name is not rendered&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function list_people (control, people, etal)&lt;br /&gt;
	local sep;&lt;br /&gt;
	local namesep;&lt;br /&gt;
	local format = control.format;&lt;br /&gt;
	local maximum = control.maximum;&lt;br /&gt;
	local name_list = {};&lt;br /&gt;
&lt;br /&gt;
	if &#039;vanc&#039; == format then													-- Vancouver-like name styling?&lt;br /&gt;
		sep = cfg.presentation[&#039;sep_nl_vanc&#039;];									-- name-list separator between names is a comma&lt;br /&gt;
		namesep = cfg.presentation[&#039;sep_name_vanc&#039;];							-- last/first separator is a space&lt;br /&gt;
	else&lt;br /&gt;
		sep = cfg.presentation[&#039;sep_nl&#039;];										-- name-list separator between names is a semicolon&lt;br /&gt;
		namesep = cfg.presentation[&#039;sep_name&#039;];									-- last/first separator is &amp;lt;comma&amp;gt;&amp;lt;space&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if sep:sub (-1, -1) ~= &amp;quot; &amp;quot; then sep = sep .. &amp;quot; &amp;quot; end&lt;br /&gt;
	if utilities.is_set (maximum) and maximum &amp;lt; 1 then return &amp;quot;&amp;quot;, 0; end		-- returned 0 is for EditorCount; not used for other names&lt;br /&gt;
	&lt;br /&gt;
	for i, person in ipairs (people) do&lt;br /&gt;
		if utilities.is_set (person.last) then&lt;br /&gt;
			local mask = person.mask;&lt;br /&gt;
			local one;&lt;br /&gt;
			local sep_one = sep;&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (maximum) and i &amp;gt; maximum then&lt;br /&gt;
				etal = true;&lt;br /&gt;
				break;&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			if mask then&lt;br /&gt;
				local n = tonumber (mask);										-- convert to a number if it can be converted; nil else&lt;br /&gt;
				if n then&lt;br /&gt;
					one = 0 ~= n and string.rep(&amp;quot;&amp;amp;mdash;&amp;quot;, n) or nil;			-- make a string of (n &amp;gt; 0) mdashes, nil else, to replace name&lt;br /&gt;
					person.link = nil;											-- don&#039;t create link to name if name is replaces with mdash string or has been set nil&lt;br /&gt;
				else&lt;br /&gt;
					one = mask;													-- replace name with mask text (must include name-list separator)&lt;br /&gt;
					sep_one = &amp;quot; &amp;quot;;												-- modify name-list separator&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				one = person.last;												-- get surname&lt;br /&gt;
				local first = person.first										-- get given name&lt;br /&gt;
				if utilities.is_set (first) then&lt;br /&gt;
					if (&amp;quot;vanc&amp;quot; == format) then									-- if Vancouver format&lt;br /&gt;
						one = one:gsub (&#039;%.&#039;, &#039;&#039;);								-- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)&lt;br /&gt;
						if not person.corporate and is_good_vanc_name (one, first, nil, i) then		-- and name is all Latin characters; corporate authors not tested&lt;br /&gt;
							first = reduce_to_initials (first, i);				-- attempt to convert first name(s) to initials&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					one = one .. namesep .. first;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if utilities.is_set (person.link) then&lt;br /&gt;
				one = utilities.make_wikilink (person.link, one);				-- link author/editor&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if one then															-- if &amp;lt;one&amp;gt; has a value (name, mdash replacement, or mask text replacement)&lt;br /&gt;
				local proj, tag = interwiki_prefixen_get (one, true);			-- get the interwiki prefixen if present&lt;br /&gt;
				if &#039;w&#039; == proj and (&#039;Wikipedia&#039; == mw.site.namespaces.Project[&#039;name&#039;]) then&lt;br /&gt;
					proj = nil;													-- for stuff like :w:de:&amp;lt;article&amp;gt;, :w is unnecessary TODO: maint cat?&lt;br /&gt;
				end&lt;br /&gt;
				if proj then&lt;br /&gt;
					local proj_name = ({[&#039;d&#039;] = &#039;Wikidata&#039;, [&#039;s&#039;] = &#039;Wikisource&#039;, [&#039;w&#039;] = &#039;Wikipedia&#039;})[proj];	-- :w (wikipedia) for linking from a non-wikipedia project&lt;br /&gt;
					if proj_name then &lt;br /&gt;
						one = one .. utilities.wrap_style (&#039;interproj&#039;, proj_name);	-- add resized leading space, brackets, static text, language name&lt;br /&gt;
						utilities.add_prop_cat (&#039;interproj-linked-name&#039;, proj);	-- categorize it; &amp;lt;proj&amp;gt; is sort key&lt;br /&gt;
						tag = nil;												-- unset; don&#039;t do both project and language&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				if tag == cfg.this_wiki_code then&lt;br /&gt;
					tag = nil;													-- stuff like :en:&amp;lt;article&amp;gt; at en.wiki is pointless TODO: maint cat?&lt;br /&gt;
				end&lt;br /&gt;
				if tag then&lt;br /&gt;
					local lang = cfg.lang_tag_remap[tag] or cfg.mw_languages_by_tag_t[tag];&lt;br /&gt;
					if lang then												-- error messaging done in extract_names() where we know parameter names&lt;br /&gt;
						one = one .. utilities.wrap_style (&#039;interwiki&#039;, lang);	-- add resized leading space, brackets, static text, language name&lt;br /&gt;
						utilities.add_prop_cat (&#039;interwiki-linked-name&#039;, tag);	-- categorize it; &amp;lt;tag&amp;gt; is sort key&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				table.insert (name_list, one);									-- add it to the list of names&lt;br /&gt;
				table.insert (name_list, sep_one);								-- add the proper name-list separator&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local count = #name_list / 2;												-- (number of names + number of separators) divided by 2&lt;br /&gt;
	if 0 &amp;lt; count then &lt;br /&gt;
		if 1 &amp;lt; count and not etal then&lt;br /&gt;
			if &#039;amp&#039; == format then&lt;br /&gt;
				name_list[#name_list-2] = &amp;quot; &amp;amp; &amp;quot;;								-- replace last separator with ampersand text&lt;br /&gt;
			elseif &#039;and&#039; == format then&lt;br /&gt;
				if 2 == count then&lt;br /&gt;
					name_list[#name_list-2] = cfg.presentation.sep_nl_and;		-- replace last separator with &#039;and&#039; text&lt;br /&gt;
				else&lt;br /&gt;
					name_list[#name_list-2] = cfg.presentation.sep_nl_end;		-- replace last separator with &#039;(sep) and&#039; text&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		name_list[#name_list] = nil;											-- erase the last separator&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local result = table.concat (name_list);									-- construct list&lt;br /&gt;
	if etal and utilities.is_set (result) then									-- etal may be set by |display-authors=etal but we might not have a last-first list&lt;br /&gt;
		result = result .. sep .. cfg.messages[&#039;et al&#039;];						-- we&#039;ve got a last-first list and etal so add et al.&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return result, count;														-- return name-list string and count of number of names (count used for editor names only)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------&amp;lt; M A K E _ C I T E R E F _ I D &amp;gt;-----------------------&lt;br /&gt;
&lt;br /&gt;
Generates a CITEREF anchor ID if we have at least one name or a date.  Otherwise&lt;br /&gt;
returns an empty string.&lt;br /&gt;
&lt;br /&gt;
namelist is one of the contributor-, author-, or editor-name lists chosen in that&lt;br /&gt;
order.  year is Year or anchor_year.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function make_citeref_id (namelist, year)&lt;br /&gt;
	local names={};							-- a table for the one to four names and year&lt;br /&gt;
	for i,v in ipairs (namelist) do			-- loop through the list and take up to the first four last names&lt;br /&gt;
		names[i] = v.last&lt;br /&gt;
		if i == 4 then break end			-- if four then done&lt;br /&gt;
	end&lt;br /&gt;
	table.insert (names, year);				-- add the year at the end&lt;br /&gt;
	local id = table.concat(names);			-- concatenate names and year for CITEREF id&lt;br /&gt;
	if utilities.is_set (id) then			-- if concatenation is not an empty string&lt;br /&gt;
		return &amp;quot;CITEREF&amp;quot; .. id;				-- add the CITEREF portion&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;&#039;;							-- return an empty string; no reason to include CITEREF id in this citation&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C I T E _ C L A S S _A T T R I B U T E _M A K E &amp;gt;------------------------------&lt;br /&gt;
&lt;br /&gt;
construct &amp;lt;cite&amp;gt; tag class attribute for this citation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cite_class&amp;gt; – config.CitationClass from calling template&lt;br /&gt;
&amp;lt;mode&amp;gt; – value from |mode= parameter&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function cite_class_attribute_make (cite_class, mode)&lt;br /&gt;
	local class_t = {};&lt;br /&gt;
	table.insert (class_t, &#039;citation&#039;);											-- required for blue highlight&lt;br /&gt;
	if &#039;citation&#039; ~= cite_class then&lt;br /&gt;
		table.insert (class_t, cite_class);										-- identify this template for user css&lt;br /&gt;
		table.insert (class_t, utilities.is_set (mode) and mode or &#039;cs1&#039;);		-- identify the citation style for user css or javascript&lt;br /&gt;
	else&lt;br /&gt;
		table.insert (class_t, utilities.is_set (mode) and mode or &#039;cs2&#039;);		-- identify the citation style for user css or javascript&lt;br /&gt;
	end&lt;br /&gt;
	for _, prop_key in ipairs (z.prop_keys_t) do&lt;br /&gt;
		table.insert (class_t, prop_key);										-- identify various properties for user css or javascript&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat (class_t, &#039; &#039;);											-- make a big string and done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[---------------------&amp;lt; N A M E _ H A S _ E T A L &amp;gt;--------------------------&lt;br /&gt;
&lt;br /&gt;
Evaluates the content of name parameters (author, editor, etc.) for variations on&lt;br /&gt;
the theme of et al.  If found, the et al. is removed, a flag is set to true and&lt;br /&gt;
the function returns the modified name and the flag.&lt;br /&gt;
&lt;br /&gt;
This function never sets the flag to false but returns its previous state because&lt;br /&gt;
it may have been set by previous passes through this function or by the associated&lt;br /&gt;
|display-&amp;lt;names&amp;gt;=etal parameter&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function name_has_etal (name, etal, nocat, param)&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (name) then												-- name can be nil in which case just return&lt;br /&gt;
		local patterns = cfg.et_al_patterns; 									-- get patterns from configuration&lt;br /&gt;
		&lt;br /&gt;
		for _, pattern in ipairs (patterns) do									-- loop through all of the patterns&lt;br /&gt;
			if name:match (pattern) then										-- if this &#039;et al&#039; pattern is found in name&lt;br /&gt;
				name = name:gsub (pattern, &#039;&#039;);									-- remove the offending text&lt;br /&gt;
				etal = true;													-- set flag (may have been set previously here or by |display-&amp;lt;names&amp;gt;=etal)&lt;br /&gt;
				if not nocat then												-- no categorization for |vauthors=&lt;br /&gt;
					utilities.set_message (&#039;err_etal&#039;, {param});				-- and set an error if not added&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return name, etal;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[---------------------&amp;lt; N A M E _ I S _ N U M E R I C &amp;gt;----------------------&lt;br /&gt;
&lt;br /&gt;
Add an error message and category when &amp;lt;name&amp;gt; parameter value does not contain letters.  &lt;br /&gt;
&lt;br /&gt;
Add a maintenance category when &amp;lt;name&amp;gt; parameter value has numeric characters mixed with characters that are &lt;br /&gt;
not numeric characters; could be letters and/or punctuation characters.&lt;br /&gt;
&lt;br /&gt;
This function will only emit one error and one maint message for the current template.  Does not emit both error&lt;br /&gt;
and maint messages/categories for the same parameter value.&lt;br /&gt;
&lt;br /&gt;
returns nothing&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function name_is_numeric (name, name_alias, list_name)&lt;br /&gt;
	local patterns = {&lt;br /&gt;
		&#039;^%D+%d&#039;,																-- &amp;lt;name&amp;gt; must have digits preceded by other characters&lt;br /&gt;
		&#039;^%D*%d+%D+&#039;,															-- &amp;lt;name&amp;gt; must have digits followed by other characters&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	if not added_numeric_name_errs and mw.ustring.match (name, &#039;^[%A]+$&#039;) then	-- if we have not already set an error message and &amp;lt;name&amp;gt; does not have any alpha characters&lt;br /&gt;
		utilities.set_message (&#039;err_numeric_names&#039;, name_alias);				-- add an error message&lt;br /&gt;
		added_numeric_name_errs = true;											-- set the flag so we emit only one error message&lt;br /&gt;
		return;																	-- when here no point in further testing; abandon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not added_numeric_name_maint then										-- if we have already set a maint message&lt;br /&gt;
		for _, pattern in ipairs (patterns) do									-- spin through list of patterns&lt;br /&gt;
			if mw.ustring.match (name, pattern) then							-- digits preceded or followed by anything but digits; %D+ includes punctuation&lt;br /&gt;
				utilities.set_message (&#039;maint_numeric_names&#039;, cfg.special_case_translation [list_name]);	-- add a maint cat for this template&lt;br /&gt;
				added_numeric_name_maint = true;								-- set the flag so we emit only one maint message&lt;br /&gt;
				return;															-- when here no point in further testing; abandon&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-----------------&amp;lt; N A M E _ H A S _ M U L T _ N A M E S &amp;gt;------------------&lt;br /&gt;
&lt;br /&gt;
Evaluates the content of last/surname (authors etc.) parameters for multiple names.&lt;br /&gt;
Multiple names are indicated if there is more than one comma or any &amp;quot;unescaped&amp;quot;&lt;br /&gt;
semicolons. Escaped semicolons are ones used as part of selected HTML entities.&lt;br /&gt;
If the condition is met, the function adds the multiple name maintenance category.&lt;br /&gt;
&lt;br /&gt;
Same test for first except that commas should not appear in given names (MOS:JR says&lt;br /&gt;
that the generational suffix does not take a separator character).  Titles, degrees,&lt;br /&gt;
postnominals, affiliations, all normally comma separated don&#039;t belong in a citation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;name&amp;gt; – name parameter value&lt;br /&gt;
&amp;lt;list_name&amp;gt; – AuthorList, EditorList, etc&lt;br /&gt;
&amp;lt;limit&amp;gt; – number of allowed commas; 1 (default) for surnames; 0 for given names&lt;br /&gt;
&lt;br /&gt;
returns nothing&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function name_has_mult_names (name, list_name, limit)&lt;br /&gt;
	local _, commas, semicolons, nbsps;&lt;br /&gt;
	limit = limit and limit or 1;&lt;br /&gt;
	if utilities.is_set (name) then&lt;br /&gt;
		_, commas = name:gsub (&#039;,&#039;, &#039;&#039;);										-- count the number of commas&lt;br /&gt;
		_, semicolons = name:gsub (&#039;;&#039;, &#039;&#039;);									-- count the number of semicolons&lt;br /&gt;
		-- nbsps probably should be its own separate count rather than merged in&lt;br /&gt;
		-- some way with semicolons because Lua patterns do not support the&lt;br /&gt;
		-- grouping operator that regex does, which means there is no way to add&lt;br /&gt;
		-- more entities to escape except by adding more counts with the new&lt;br /&gt;
		-- entities&lt;br /&gt;
		_, nbsps = name:gsub (&#039;&amp;amp;nbsp;&#039;,&#039;&#039;);										-- count nbsps&lt;br /&gt;
		&lt;br /&gt;
		-- There is exactly 1 semicolon per &amp;amp;nbsp; entity, so subtract nbsps&lt;br /&gt;
		-- from semicolons to &#039;escape&#039; them. If additional entities are added,&lt;br /&gt;
		-- they also can be subtracted.&lt;br /&gt;
		if limit &amp;lt; commas or 0 &amp;lt; (semicolons - nbsps) then&lt;br /&gt;
			utilities.set_message (&#039;maint_mult_names&#039;, cfg.special_case_translation [list_name]);	-- add a maint message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; I S _ G E N E R I C &amp;gt;----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Compares values assigned to various parameters according to the string provided as &amp;lt;item&amp;gt; in the function call.&lt;br /&gt;
&amp;lt;item&amp;gt; can have on of two values:&lt;br /&gt;
	&#039;generic_names&#039; – for name-holding parameters: |last=, |first=, |editor-last=, etc&lt;br /&gt;
	&#039;generic_titles&#039; – for |title=&lt;br /&gt;
&lt;br /&gt;
There are two types of generic tests.  The &#039;accept&#039; tests look for a pattern that should not be rejected by the&lt;br /&gt;
&#039;reject&#039; test.  For example,&lt;br /&gt;
	|author=[[John Smith (author)|Smith, John]]&lt;br /&gt;
would be rejected by the &#039;author&#039; reject test.  But piped wikilinks with &#039;author&#039; disambiguation should not be&lt;br /&gt;
rejected so the &#039;accept&#039; test prevents that from happening.  Accept tests are always performed before reject&lt;br /&gt;
tests.&lt;br /&gt;
&lt;br /&gt;
Each of the &#039;accept&#039; and &#039;reject&#039; sequence tables hold tables for en.wiki ([&#039;en&#039;]) and local.wiki ([&#039;local&#039;])&lt;br /&gt;
that each can hold a test sequence table  The sequence table holds, at index [1], a test pattern, and, at index&lt;br /&gt;
[2], a boolean control value.  The control value tells string.find() or mw.ustring.find() to do plain-text search (true)&lt;br /&gt;
or a pattern search (false).  The intent of all this complexity is to make these searches as fast as possible so&lt;br /&gt;
that we don&#039;t run out of processing time on very large articles.&lt;br /&gt;
&lt;br /&gt;
Returns&lt;br /&gt;
	true when a reject test finds the pattern or string&lt;br /&gt;
	false when an accept test finds the pattern or string&lt;br /&gt;
	nil else&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function is_generic (item, value, wiki)&lt;br /&gt;
	local test_val;&lt;br /&gt;
	local str_lower = {															-- use string.lower() for en.wiki ([&#039;en&#039;]) and use mw.ustring.lower() or local.wiki ([&#039;local&#039;])&lt;br /&gt;
		[&#039;en&#039;] = string.lower,&lt;br /&gt;
		[&#039;local&#039;] = mw.ustring.lower,&lt;br /&gt;
		}&lt;br /&gt;
	local str_find = {															-- use string.find() for en.wiki ([&#039;en&#039;]) and use mw.ustring.find() or local.wiki ([&#039;local&#039;])&lt;br /&gt;
		[&#039;en&#039;] = string.find,&lt;br /&gt;
		[&#039;local&#039;] = mw.ustring.find,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	local function test (val, test_t, wiki)										-- local function to do the testing; &amp;lt;wiki&amp;gt; selects lower() and find() functions&lt;br /&gt;
		val = test_t[2] and str_lower[wiki](value) or val;						-- when &amp;lt;test_t[2]&amp;gt; set to &#039;true&#039;, plaintext search using lowercase value&lt;br /&gt;
		return str_find[wiki] (val, test_t[1], 1, test_t[2]);					-- return nil when not found or matched&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	local test_types_t = {&#039;accept&#039;, &#039;reject&#039;};									-- test accept patterns first, then reject patterns&lt;br /&gt;
	local wikis_t = {&#039;en&#039;, &#039;local&#039;};											-- do tests for each of these keys; en.wiki first, local.wiki second&lt;br /&gt;
&lt;br /&gt;
	for _, test_type in ipairs (test_types_t) do								-- for each test type&lt;br /&gt;
		for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do	-- spin through the list of generic value fragments to accept or reject&lt;br /&gt;
			for _, wiki in ipairs (wikis_t) do&lt;br /&gt;
				if generic_value[wiki] then&lt;br /&gt;
					if test (value, generic_value[wiki], wiki) then				-- go do the test&lt;br /&gt;
						return (&#039;reject&#039; == test_type);							-- param value rejected, return true; false else&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; N A M E _ I S _ G E N E R I C &amp;gt;------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
calls is_generic() to determine if &amp;lt;name&amp;gt; is a &#039;generic name&#039; listed in cfg.generic_names; &amp;lt;name_alias&amp;gt; is the&lt;br /&gt;
parameter name used in error messaging&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function name_is_generic (name, name_alias)&lt;br /&gt;
	if not added_generic_name_errs  and is_generic (&#039;generic_names&#039;, name) then&lt;br /&gt;
		utilities.set_message (&#039;err_generic_name&#039;, name_alias);					-- set an error message&lt;br /&gt;
		added_generic_name_errs = true;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; N A M E _ C H E C K S &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This function calls various name checking functions used to validate the content of the various name-holding parameters.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function name_checks (last, first, list_name, last_alias, first_alias)&lt;br /&gt;
	local accept_name;&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (last) then&lt;br /&gt;
		last, accept_name = utilities.has_accept_as_written (last);				-- remove accept-this-as-written markup when it wraps all of &amp;lt;last&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		if not accept_name then													-- &amp;lt;last&amp;gt; not wrapped in accept-as-written markup&lt;br /&gt;
			name_has_mult_names (last, list_name);								-- check for multiple names in the parameter&lt;br /&gt;
			name_is_numeric (last, last_alias, list_name);						-- check for names that have no letters or are a mix of digits and other characters&lt;br /&gt;
			name_is_generic (last, last_alias);									-- check for names found in the generic names list&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (first) then&lt;br /&gt;
		first, accept_name = utilities.has_accept_as_written (first);			-- remove accept-this-as-written markup when it wraps all of &amp;lt;first&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		if not accept_name then													-- &amp;lt;first&amp;gt; not wrapped in accept-as-written markup&lt;br /&gt;
			name_has_mult_names (first, list_name, 0);							-- check for multiple names in the parameter; 0 is number of allowed commas in a given name&lt;br /&gt;
			name_is_numeric (first, first_alias, list_name);					-- check for names that have no letters or are a mix of digits and other characters&lt;br /&gt;
			name_is_generic (first, first_alias);								-- check for names found in the generic names list&lt;br /&gt;
		end&lt;br /&gt;
		local wl_type, D = utilities.is_wikilink (first);&lt;br /&gt;
		if 0 ~= wl_type then&lt;br /&gt;
			first = D;&lt;br /&gt;
			utilities.set_message (&#039;err_bad_paramlink&#039;, first_alias);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return last, first;															-- done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------------------&amp;lt; E X T R A C T _ N A M E S &amp;gt;-------------------------&lt;br /&gt;
&lt;br /&gt;
Gets name list from the input arguments&lt;br /&gt;
&lt;br /&gt;
Searches through args in sequential order to find |lastn= and |firstn= parameters&lt;br /&gt;
(or their aliases), and their matching link and mask parameters. Stops searching&lt;br /&gt;
when both |lastn= and |firstn= are not found in args after two sequential attempts:&lt;br /&gt;
found |last1=, |last2=, and |last3= but doesn&#039;t find |last4= and |last5= then the&lt;br /&gt;
search is done.&lt;br /&gt;
&lt;br /&gt;
This function emits an error message when there is a |firstn= without a matching&lt;br /&gt;
|lastn=.  When there are &#039;holes&#039; in the list of last names, |last1= and |last3=&lt;br /&gt;
are present but |last2= is missing, an error message is emitted. |lastn= is not&lt;br /&gt;
required to have a matching |firstn=.&lt;br /&gt;
&lt;br /&gt;
When an author or editor parameter contains some form of &#039;et al.&#039;, the &#039;et al.&#039;&lt;br /&gt;
is stripped from the parameter and a flag (etal) returned that will cause list_people()&lt;br /&gt;
to add the static &#039;et al.&#039; text from Module:Citation/CS1/Configuration.  This keeps&lt;br /&gt;
&#039;et al.&#039; out of the template&#039;s metadata.  When this occurs, an error is emitted.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function extract_names(args, list_name)&lt;br /&gt;
	local names = {};															-- table of names&lt;br /&gt;
	local last;																	-- individual name components&lt;br /&gt;
	local first;&lt;br /&gt;
	local link;&lt;br /&gt;
	local mask;&lt;br /&gt;
	local i = 1;																-- loop counter/indexer&lt;br /&gt;
	local n = 1;																-- output table indexer&lt;br /&gt;
	local count = 0;															-- used to count the number of times we haven&#039;t found a |last= (or alias for authors, |editor-last or alias for editors)&lt;br /&gt;
	local etal = false;															-- return value set to true when we find some form of et al. in an author parameter&lt;br /&gt;
&lt;br /&gt;
	local last_alias, first_alias, link_alias;									-- selected parameter aliases used in error messaging&lt;br /&gt;
	while true do&lt;br /&gt;
		last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Last&#039;], &#039;err_redundant_parameters&#039;, i );		-- search through args for name components beginning at 1&lt;br /&gt;
		first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. &#039;-First&#039;], &#039;err_redundant_parameters&#039;, i );&lt;br /&gt;
		link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Link&#039;], &#039;err_redundant_parameters&#039;, i );&lt;br /&gt;
		mask = utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Mask&#039;], &#039;err_redundant_parameters&#039;, i );&lt;br /&gt;
	&lt;br /&gt;
		if last then															-- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name&lt;br /&gt;
			local project, language = interwiki_prefixen_get (last, true);		-- true because we expect interwiki links in |lastn= to be wikilinked&lt;br /&gt;
			if nil == project and nil == language then							-- when both are nil&lt;br /&gt;
				utilities.set_message (&#039;err_bad_paramlink&#039;, last_alias);		-- not known, emit an error message	-- TODO: err_bad_interwiki?&lt;br /&gt;
				last = utilities.remove_wiki_link (last);						-- remove wikilink markup; show display value only&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if link then															-- error check |linkn= alias for unknown interwiki link prefix&lt;br /&gt;
			local project, language = interwiki_prefixen_get (link, false);		-- false because wiki links in |author-linkn= is an error&lt;br /&gt;
			if nil == project and nil == language then							-- when both are nil&lt;br /&gt;
				utilities.set_message (&#039;err_bad_paramlink&#039;, link_alias);		-- not known, emit an error message	-- TODO: err_bad_interwiki?&lt;br /&gt;
				link = nil;														-- unset so we don&#039;t link&lt;br /&gt;
				link_alias = nil;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		last, etal = name_has_etal (last, etal, false, last_alias);				-- find and remove variations on et al.&lt;br /&gt;
		first, etal = name_has_etal (first, etal, false, first_alias);			-- find and remove variations on et al.&lt;br /&gt;
		last, first = name_checks (last, first, list_name, last_alias, first_alias);						-- multiple names, extraneous annotation, etc. checks&lt;br /&gt;
&lt;br /&gt;
		if first and not last then												-- if there is a firstn without a matching lastn&lt;br /&gt;
			local alias = first_alias:find (&#039;given&#039;, 1, true) and &#039;given&#039; or &#039;first&#039;;	-- get first or given form of the alias&lt;br /&gt;
			utilities.set_message (&#039;err_first_missing_last&#039;, {&lt;br /&gt;
				first_alias,													-- param name of alias missing its mate&lt;br /&gt;
				first_alias:gsub (alias, {[&#039;first&#039;] = &#039;last&#039;, [&#039;given&#039;] = &#039;surname&#039;}),	-- make param name appropriate to the alias form&lt;br /&gt;
				});																-- add this error message&lt;br /&gt;
		elseif not first and not last then										-- if both firstn and lastn aren&#039;t found, are we done?&lt;br /&gt;
			count = count + 1;													-- number of times we haven&#039;t found last and first&lt;br /&gt;
			if 2 &amp;lt;= count then													-- two missing names and we give up&lt;br /&gt;
				break;															-- normal exit or there is a two-name hole in the list; can&#039;t tell which&lt;br /&gt;
			end&lt;br /&gt;
		else																	-- we have last with or without a first&lt;br /&gt;
			local result;&lt;br /&gt;
			link = link_title_ok (link, link_alias, last, last_alias);			-- check for improper wiki-markup&lt;br /&gt;
&lt;br /&gt;
			if first then&lt;br /&gt;
				link = link_title_ok (link, link_alias, first, first_alias);	-- check for improper wiki-markup&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			names[n] = {last = last, first = first, link = link, mask = mask, corporate = false};	-- add this name to our names list (corporate for |vauthors= only)&lt;br /&gt;
			n = n + 1;															-- point to next location in the names table&lt;br /&gt;
			if 1 == count then													-- if the previous name was missing&lt;br /&gt;
				utilities.set_message (&#039;err_missing_name&#039;, {list_name:match (&amp;quot;(%w+)List&amp;quot;):lower(), i - 1});	-- add this error message&lt;br /&gt;
			end&lt;br /&gt;
			count = 0;															-- reset the counter, we&#039;re looking for two consecutive missing names&lt;br /&gt;
		end&lt;br /&gt;
		i = i + 1;																-- point to next args location&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return names, etal;															-- all done, return our list of names and the etal flag&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; N A M E _ T A G _ G E T &amp;gt;------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
attempt to decode |language=&amp;lt;lang_param&amp;gt; and return language name and matching tag; nil else.&lt;br /&gt;
&lt;br /&gt;
This function looks for:&lt;br /&gt;
	&amp;lt;lang_param&amp;gt; as a tag in cfg.lang_tag_remap{}&lt;br /&gt;
	&amp;lt;lang_param&amp;gt; as a name in cfg.lang_name_remap{}&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;lang_param&amp;gt; as a name in cfg.mw_languages_by_name_t&lt;br /&gt;
	&amp;lt;lang_param&amp;gt; as a tag in cfg.mw_languages_by_tag_t&lt;br /&gt;
when those fail, presume that &amp;lt;lang_param&amp;gt; is an IETF-like tag that MediaWiki does not recognize.  Strip all&lt;br /&gt;
script, region, variant, whatever subtags from &amp;lt;lang_param&amp;gt; to leave just a two or three character language tag&lt;br /&gt;
and look for the new &amp;lt;lang_param&amp;gt; in cfg.mw_languages_by_tag_t{}&lt;br /&gt;
&lt;br /&gt;
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function name_tag_get (lang_param)&lt;br /&gt;
	local lang_param_lc = mw.ustring.lower (lang_param);						-- use lowercase as an index into the various tables&lt;br /&gt;
	local name;&lt;br /&gt;
	local tag;&lt;br /&gt;
&lt;br /&gt;
	name = cfg.lang_tag_remap[lang_param_lc];									-- assume &amp;lt;lang_param_lc&amp;gt; is a tag; attempt to get remapped language name &lt;br /&gt;
	if name then																-- when &amp;lt;name&amp;gt;, &amp;lt;lang_param&amp;gt; is a tag for a remapped language name&lt;br /&gt;
		if cfg.lang_name_remap[name:lower()][2] ~= lang_param_lc then&lt;br /&gt;
			utilities.set_message (&#039;maint_unknown_lang&#039;);						-- add maint category if not already added&lt;br /&gt;
			return name, cfg.lang_name_remap[name:lower()][2];					-- so return name and tag from lang_name_remap[name]; special case to xlate sr-ec and sr-el to sr-cyrl and sr-latn&lt;br /&gt;
		end&lt;br /&gt;
		return name, lang_param_lc;												-- so return &amp;lt;name&amp;gt; from remap and &amp;lt;lang_param_lc&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	tag = lang_param_lc:match (&#039;^(%a%a%a?)%-.*&#039;);								-- still assuming that &amp;lt;lang_param_lc&amp;gt; is a tag; strip script, region, variant subtags&lt;br /&gt;
	name = cfg.lang_tag_remap[tag];												-- attempt to get remapped language name with language subtag only&lt;br /&gt;
	if name then																-- when &amp;lt;name&amp;gt;, &amp;lt;tag&amp;gt; is a tag for a remapped language name&lt;br /&gt;
		return name, tag;														-- so return &amp;lt;name&amp;gt; from remap and &amp;lt;tag&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if cfg.lang_name_remap[lang_param_lc] then									-- not a remapped tag, assume &amp;lt;lang_param_lc&amp;gt; is a name; attempt to get remapped language tag &lt;br /&gt;
		return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2];	-- for this &amp;lt;lang_param_lc&amp;gt;, return a (possibly) new name and appropriate tag&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	name = cfg.mw_languages_by_tag_t[lang_param_lc];							-- assume that &amp;lt;lang_param_lc&amp;gt; is a tag; attempt to get its matching language name&lt;br /&gt;
	&lt;br /&gt;
	if name then&lt;br /&gt;
		return name, lang_param_lc;												-- &amp;lt;lang_param_lc&amp;gt; is a tag so return it and &amp;lt;name&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	tag = cfg.mw_languages_by_name_t[lang_param_lc];							-- assume that &amp;lt;lang_param_lc&amp;gt; is a language name; attempt to get its matching tag&lt;br /&gt;
	&lt;br /&gt;
	if tag then&lt;br /&gt;
		return cfg.mw_languages_by_tag_t[tag], tag;								-- &amp;lt;lang_param_lc&amp;gt; is a name so return the name from the table and &amp;lt;tag&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	tag = lang_param_lc:match (&#039;^(%a%a%a?)%-.*&#039;);								-- is &amp;lt;lang_param_lc&amp;gt; an IETF-like tag that MediaWiki doesn&#039;t recognize? &amp;lt;tag&amp;gt; gets the language subtag; nil else&lt;br /&gt;
&lt;br /&gt;
	if tag then&lt;br /&gt;
		name = cfg.mw_languages_by_tag_t[tag];									-- attempt to get a language name using the shortened &amp;lt;tag&amp;gt;&lt;br /&gt;
		if name then&lt;br /&gt;
			return name, tag;													-- &amp;lt;lang_param_lc&amp;gt; is an unrecognized IETF-like tag so return &amp;lt;name&amp;gt; and language subtag&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-------------------&amp;lt; L A N G U A G E _ P A R A M E T E R &amp;gt;------------------&lt;br /&gt;
&lt;br /&gt;
Gets language name from a provided two- or three-character ISO 639 code.  If a code&lt;br /&gt;
is recognized by MediaWiki, use the returned name; if not, then use the value that&lt;br /&gt;
was provided with the language parameter.&lt;br /&gt;
&lt;br /&gt;
When |language= contains a recognized language (either code or name), the page is&lt;br /&gt;
assigned to the category for that code: Category:Norwegian-language sources (no).&lt;br /&gt;
For valid three-character code languages, the page is assigned to the single category&lt;br /&gt;
for &#039;639-2&#039; codes: Category:CS1 ISO 639-2 language sources.&lt;br /&gt;
&lt;br /&gt;
Languages that are the same as the local wiki are not categorized.  MediaWiki does&lt;br /&gt;
not recognize three-character equivalents of two-character codes: code &#039;ar&#039; is&lt;br /&gt;
recognized but code &#039;ara&#039; is not.&lt;br /&gt;
&lt;br /&gt;
This function supports multiple languages in the form |language=nb, French, th&lt;br /&gt;
where the language names or codes are separated from each other by commas with&lt;br /&gt;
optional space characters.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function language_parameter (lang)&lt;br /&gt;
	local tag;																	-- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags&lt;br /&gt;
	local lang_subtag;															-- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag&lt;br /&gt;
	local name;																	-- the language name&lt;br /&gt;
	local language_list = {};													-- table of language names to be rendered&lt;br /&gt;
	local names_t = {};															-- table made from the value assigned to |language=&lt;br /&gt;
&lt;br /&gt;
	local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code);	-- get this wiki&#039;s language name&lt;br /&gt;
&lt;br /&gt;
	names_t = mw.text.split (lang, &#039;%s*,%s*&#039;);									-- names should be a comma separated list&lt;br /&gt;
&lt;br /&gt;
	for _, lang in ipairs (names_t) do											-- reuse lang here because we don&#039;t yet know if lang is a language name or a language tag&lt;br /&gt;
		name, tag = name_tag_get (lang);										-- attempt to get name/tag pair for &amp;lt;lang&amp;gt;; &amp;lt;name&amp;gt; has proper capitalization; &amp;lt;tag&amp;gt; is lowercase&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (tag) then&lt;br /&gt;
			lang_subtag = tag:gsub (&#039;^(%a%a%a?)%-.*&#039;, &#039;%1&#039;);					-- for categorization, strip any IETF-like tags from language tag&lt;br /&gt;
&lt;br /&gt;
			if cfg.this_wiki_code ~= lang_subtag then							-- when the language is not the same as this wiki&#039;s language&lt;br /&gt;
				if 2 == lang_subtag:len() then									-- and is a two-character tag&lt;br /&gt;
					utilities.add_prop_cat (&#039;foreign-lang-source&#039;, {name, tag}, lang_subtag);		-- categorize it; tag appended to allow for multiple language categorization&lt;br /&gt;
				else															-- or is a recognized language (but has a three-character tag)&lt;br /&gt;
					utilities.add_prop_cat (&#039;foreign-lang-source-2&#039;, {lang_subtag}, lang_subtag);			-- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?&lt;br /&gt;
				end&lt;br /&gt;
			elseif cfg.local_lang_cat_enable then								-- when the language and this wiki&#039;s language are the same and categorization is enabled&lt;br /&gt;
				utilities.add_prop_cat (&#039;local-lang-source&#039;, {name, lang_subtag});		-- categorize it&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			name = lang;														-- return whatever &amp;lt;lang&amp;gt; has so that we show something&lt;br /&gt;
			utilities.set_message (&#039;maint_unknown_lang&#039;);						-- add maint category if not already added&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		table.insert (language_list, name);&lt;br /&gt;
		name = &#039;&#039;;																-- so we can reuse it&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	name = utilities.make_sep_list (#language_list, language_list);&lt;br /&gt;
	if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then		-- when only one language, find lang name in this wiki lang name; for |language=en-us, &#039;English&#039; in &#039;American English&#039;&lt;br /&gt;
		return &#039;&#039;;																-- if one language and that language is this wiki&#039;s return an empty string (no annotation)&lt;br /&gt;
	end&lt;br /&gt;
	return (&amp;quot; &amp;quot; .. wrap_msg (&#039;language&#039;, name));								-- otherwise wrap with &#039;(in ...)&#039;&lt;br /&gt;
	--[[ TODO: should only return blank or name rather than full list&lt;br /&gt;
	so we can clean up the bunched parenthetical elements Language, Type, Format&lt;br /&gt;
	]]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-----------------------&amp;lt; S E T _ C S _ S T Y L E &amp;gt;--------------------------&lt;br /&gt;
&lt;br /&gt;
Gets the default CS style configuration for the given mode.&lt;br /&gt;
Returns default separator and either postscript as passed in or the default.&lt;br /&gt;
In CS1, the default postscript and separator are &#039;.&#039;.&lt;br /&gt;
In CS2, the default postscript is the empty string and the default separator is &#039;,&#039;.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function set_cs_style (postscript, mode)&lt;br /&gt;
	if utilities.is_set(postscript) then&lt;br /&gt;
		-- emit a maintenance message if user postscript is the default cs1 postscript&lt;br /&gt;
		-- we catch the opposite case for cs2 in set_style&lt;br /&gt;
		if mode == &#039;cs1&#039; and postscript == cfg.presentation[&#039;ps_&#039; .. mode] then&lt;br /&gt;
			utilities.set_message (&#039;maint_postscript&#039;);&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		postscript = cfg.presentation[&#039;ps_&#039; .. mode];&lt;br /&gt;
	end&lt;br /&gt;
	return cfg.presentation[&#039;sep_&#039; .. mode], postscript;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S E T _ S T Y L E &amp;gt;-----------------------------&lt;br /&gt;
&lt;br /&gt;
Sets the separator and postscript styles. Checks the |mode= first and the&lt;br /&gt;
#invoke CitationClass second. Removes the postscript if postscript == none.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function set_style (mode, postscript, cite_class)&lt;br /&gt;
	local sep;&lt;br /&gt;
	if &#039;cs2&#039; == mode then&lt;br /&gt;
		sep, postscript = set_cs_style (postscript, &#039;cs2&#039;);&lt;br /&gt;
	elseif &#039;cs1&#039; == mode then&lt;br /&gt;
		sep, postscript = set_cs_style (postscript, &#039;cs1&#039;);&lt;br /&gt;
	elseif &#039;citation&#039; == cite_class	then&lt;br /&gt;
		sep, postscript = set_cs_style (postscript, &#039;cs2&#039;);&lt;br /&gt;
	else&lt;br /&gt;
		sep, postscript = set_cs_style (postscript, &#039;cs1&#039;);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if cfg.keywords_xlate[postscript:lower()] == &#039;none&#039; then&lt;br /&gt;
		-- emit a maintenance message if user postscript is the default cs2 postscript&lt;br /&gt;
		-- we catch the opposite case for cs1 in set_cs_style&lt;br /&gt;
		if &#039;cs2&#039; == mode or (&#039;cs1&#039; ~= mode and &#039;citation&#039; == cite_class) then	-- {{citation |title=Title |mode=cs1 |postscript=none}} should not emit maint message&lt;br /&gt;
			utilities.set_message (&#039;maint_postscript&#039;);&lt;br /&gt;
		end&lt;br /&gt;
		postscript = &#039;&#039;;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return sep, postscript&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; I S _ P D F &amp;gt;-----------------------------------&lt;br /&gt;
&lt;br /&gt;
Determines if a URL has the file extension that is one of the PDF file extensions&lt;br /&gt;
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.&lt;br /&gt;
&lt;br /&gt;
returns true if file extension is one of the recognized extensions, else false&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function is_pdf (url)&lt;br /&gt;
	return url:match (&#039;%.pdf$&#039;) or url:match (&#039;%.PDF$&#039;) or&lt;br /&gt;
		url:match (&#039;%.pdf[%?#]&#039;) or url:match (&#039;%.PDF[%?#]&#039;) or&lt;br /&gt;
		url:match (&#039;%.PDF&amp;amp;#035&#039;) or url:match (&#039;%.pdf&amp;amp;#035&#039;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S T Y L E _ F O R M A T &amp;gt;-----------------------&lt;br /&gt;
&lt;br /&gt;
Applies CSS style to |format=, |chapter-format=, etc.  Also emits an error message&lt;br /&gt;
if the format parameter does not have a matching URL parameter.  If the format parameter&lt;br /&gt;
is not set and the URL contains a file extension that is recognized as a PDF document&lt;br /&gt;
by MediaWiki&#039;s commons.css, this code will set the format parameter to (PDF) with&lt;br /&gt;
the appropriate styling.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function style_format (format, url, fmt_param, url_param)&lt;br /&gt;
	if utilities.is_set (format) then&lt;br /&gt;
		format = utilities.wrap_style (&#039;format&#039;, format);						-- add leading space, parentheses, resize&lt;br /&gt;
		if not utilities.is_set (url) then&lt;br /&gt;
			utilities.set_message (&#039;err_format_missing_url&#039;, {fmt_param, url_param});	-- add an error message&lt;br /&gt;
		end&lt;br /&gt;
	elseif is_pdf (url) then													-- format is not set so if URL is a PDF file then&lt;br /&gt;
		format = utilities.wrap_style (&#039;format&#039;, &#039;PDF&#039;);						-- set format to PDF&lt;br /&gt;
	else&lt;br /&gt;
		format = &#039;&#039;;															-- empty string for concatenation&lt;br /&gt;
	end&lt;br /&gt;
	return format;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[---------------------&amp;lt; G E T _ D I S P L A Y _ N A M E S &amp;gt;------------------&lt;br /&gt;
&lt;br /&gt;
Returns a number that defines the number of names displayed for author and editor&lt;br /&gt;
name lists and a Boolean flag to indicate when et al. should be appended to the name list.&lt;br /&gt;
&lt;br /&gt;
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,&lt;br /&gt;
return the number and the previous state of the &#039;etal&#039; flag (false by default&lt;br /&gt;
but may have been set to true if the name list contains some variant of the text &#039;et al.&#039;).&lt;br /&gt;
&lt;br /&gt;
When the value assigned to |display-xxxxors= is the keyword &#039;etal&#039;, return a number&lt;br /&gt;
that is one greater than the number of authors in the list and set the &#039;etal&#039; flag true.&lt;br /&gt;
This will cause the list_people() to display all of the names in the name list followed by &#039;et al.&#039;&lt;br /&gt;
&lt;br /&gt;
In all other cases, returns nil and the previous state of the &#039;etal&#039; flag.&lt;br /&gt;
&lt;br /&gt;
inputs:&lt;br /&gt;
	max: A[&#039;DisplayAuthors&#039;] or A[&#039;DisplayEditors&#039;], etc; a number or some flavor of etal&lt;br /&gt;
	count: #a or #e&lt;br /&gt;
	list_name: &#039;authors&#039; or &#039;editors&#039;&lt;br /&gt;
	etal: author_etal or editor_etal&lt;br /&gt;
&lt;br /&gt;
This function sets an error message when |display-xxxxors= value greater than or equal to number of names but&lt;br /&gt;
not when &amp;lt;max&amp;gt; comes from {{cs1 config}} global settings.  When using global settings, &amp;lt;param&amp;gt; is set to the&lt;br /&gt;
keyword &#039;cs1 config&#039; which is used to supress the normal error.  Error is suppressed because it is to be expected&lt;br /&gt;
that some citations in an article will have the same or fewer names that the limit specified in {{cs1 config}}.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function get_display_names (max, count, list_name, etal, param)&lt;br /&gt;
	if utilities.is_set (max) then&lt;br /&gt;
		if &#039;etal&#039; == max:lower():gsub(&amp;quot;[ &#039;%.]&amp;quot;, &#039;&#039;) then						-- the :gsub() portion makes &#039;etal&#039; from a variety of &#039;et al.&#039; spellings and stylings&lt;br /&gt;
			max = count + 1;													-- number of authors + 1 so display all author name plus et al.&lt;br /&gt;
			etal = true;														-- overrides value set by extract_names()&lt;br /&gt;
		elseif max:match (&#039;^%d+$&#039;) then											-- if is a string of numbers&lt;br /&gt;
			max = tonumber (max);												-- make it a number&lt;br /&gt;
			if (max &amp;gt;= count) and (&#039;cs1 config&#039; ~= param) then					-- error when local |display-xxxxors= value greater than or equal to number of names; not an error when using global setting&lt;br /&gt;
				utilities.set_message (&#039;err_disp_name&#039;, {param, max});			-- add error message&lt;br /&gt;
				max = nil;&lt;br /&gt;
			end&lt;br /&gt;
		else																	-- not a valid keyword or number&lt;br /&gt;
			utilities.set_message (&#039;err_disp_name&#039;, {param, max});				-- add error message&lt;br /&gt;
			max = nil;															-- unset; as if |display-xxxxors= had not been set&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return max, etal;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[----------&amp;lt; E X T R A _ T E X T _ I N _ P A G E _ C H E C K &amp;gt;---------------&lt;br /&gt;
&lt;br /&gt;
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be&lt;br /&gt;
some form of p. or pp. abbreviation in the first characters of the parameter content.&lt;br /&gt;
&lt;br /&gt;
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:&lt;br /&gt;
	good pattern: &#039;^P[^%.P%l]&#039; matches when page begins PX or P# but not Px&lt;br /&gt;
		      where x and X are letters and # is a digit&lt;br /&gt;
	bad pattern:  &#039;^[Pp][PpGg]&#039; matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function extra_text_in_page_check (val, name)&lt;br /&gt;
	if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then&lt;br /&gt;
		for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do		-- spin through the selected sequence table of patterns&lt;br /&gt;
			if val:match (pattern) then											-- when a match, error so&lt;br /&gt;
				utilities.set_message (&#039;err_extra_text_pages&#039;, name);	 		-- add error message&lt;br /&gt;
				return;															-- and done&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K &amp;gt;------------------------&lt;br /&gt;
&lt;br /&gt;
Adds error if |volume= or |issue= has what appears to be some form of redundant &#039;type&#039; indicator.  Applies to&lt;br /&gt;
both; this function looks for issue text in both |issue= and |volume= and looks for volume-like text in |voluem=&lt;br /&gt;
and |issue=.&lt;br /&gt;
&lt;br /&gt;
For |volume=:&lt;br /&gt;
	&#039;V.&#039;, or &#039;Vol.&#039; (with or without the dot) abbreviations or &#039;Volume&#039; in the first characters of the parameter&lt;br /&gt;
	content (all case insensitive). &#039;V&#039; and &#039;v&#039; (without the dot) are presumed to be roman numerals so&lt;br /&gt;
	are allowed.&lt;br /&gt;
&lt;br /&gt;
For |issue=:&lt;br /&gt;
	&#039;No.&#039;, &#039;I.&#039;, &#039;Iss.&#039; (with or without the dot) abbreviations, or &#039;Issue&#039; in the first characters of the&lt;br /&gt;
	parameter content (all case insensitive); numero styling: &#039;n°&#039; with degree sign U+00B0, and № precomposed&lt;br /&gt;
	numero sign U+2116.&lt;br /&gt;
	&lt;br /&gt;
Single character values (&#039;v&#039;, &#039;i&#039;, &#039;n&#039;) allowed when not followed by separator character (&#039;.&#039;, &#039;:&#039;, &#039;=&#039;, or&lt;br /&gt;
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;val&amp;gt; is |volume= or |issue= parameter value&lt;br /&gt;
&amp;lt;name&amp;gt; is |volume= or |issue= parameter name for error message&lt;br /&gt;
&amp;lt;selector&amp;gt; is &#039;v&#039; for |volume=, &#039;i&#039; for |issue=&lt;br /&gt;
&lt;br /&gt;
sets error message on failure; returns nothing&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function extra_text_in_vol_iss_check (val, name, selector)&lt;br /&gt;
	if not utilities.is_set (val) then&lt;br /&gt;
		return;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local handler = &#039;v&#039; == selector and &#039;err_extra_text_volume&#039; or &#039;err_extra_text_issue&#039;;&lt;br /&gt;
	val = val:lower();															-- force parameter value to lower case&lt;br /&gt;
&lt;br /&gt;
	for _, pattern in ipairs (cfg.vol_iss_pg_patterns.vi_patterns_t) do			-- spin through the sequence table of patterns&lt;br /&gt;
		if val:match (pattern) then												-- when a match, error so&lt;br /&gt;
			utilities.set_message (handler, name);								-- add error message&lt;br /&gt;
			return;																-- and done&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; G E T _ V _ N A M E _ T A B L E &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
split apart a |vauthors= or |veditors= parameter.  This function allows for corporate names, wrapped in doubled&lt;br /&gt;
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the&lt;br /&gt;
rendered citation and in the metadata.  Individual author names may be wikilinked&lt;br /&gt;
&lt;br /&gt;
	|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function get_v_name_table (vparam, output_table, output_link_table)&lt;br /&gt;
	local _, accept = utilities.has_accept_as_written (vparam);&lt;br /&gt;
	if accept then&lt;br /&gt;
		utilities.add_prop_cat (&#039;vanc-accept&#039;);									-- add properties category&lt;br /&gt;
	end&lt;br /&gt;
	local name_table = mw.text.split(vparam, &amp;quot;%s*,%s*&amp;quot;);						-- names are separated by commas&lt;br /&gt;
	local wl_type, label, link;													-- wl_type not used here; just a placeholder&lt;br /&gt;
	&lt;br /&gt;
	local i = 1;&lt;br /&gt;
	&lt;br /&gt;
	while name_table[i] do&lt;br /&gt;
		if name_table[i]:match (&#039;^%(%(.*[^%)][^%)]$&#039;) then						-- first segment of corporate with one or more commas; this segment has the opening doubled parentheses&lt;br /&gt;
			local name = name_table[i];&lt;br /&gt;
			i = i + 1;															-- bump indexer to next segment&lt;br /&gt;
			while name_table[i] do&lt;br /&gt;
				name = name .. &#039;, &#039; .. name_table[i];							-- concatenate with previous segments&lt;br /&gt;
				if name_table[i]:match (&#039;^.*%)%)$&#039;) then						-- if this table member has the closing doubled parentheses&lt;br /&gt;
					break;														-- and done reassembling so&lt;br /&gt;
				end&lt;br /&gt;
				i = i + 1;														-- bump indexer&lt;br /&gt;
			end&lt;br /&gt;
			table.insert (output_table, name);									-- and add corporate name to the output table&lt;br /&gt;
			table.insert (output_link_table, &#039;&#039;);								-- no wikilink&lt;br /&gt;
		else&lt;br /&gt;
			wl_type, label, link = utilities.is_wikilink (name_table[i]);		-- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]&lt;br /&gt;
			table.insert (output_table, label);									-- add this name&lt;br /&gt;
			if 1 == wl_type then&lt;br /&gt;
				table.insert (output_link_table, label);						-- simple wikilink [[D]]&lt;br /&gt;
			else&lt;br /&gt;
				table.insert (output_link_table, link);							-- no wikilink or [[L|D]]; add this link if there is one, else empty string&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		i = i + 1;&lt;br /&gt;
	end	&lt;br /&gt;
	return output_table;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; P A R S E _ V A U T H O R S _ V E D I T O R S &amp;gt;--------------------------------&lt;br /&gt;
&lt;br /&gt;
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and&lt;br /&gt;
|xxxxor-linkn= in args.  It then returns a table of assembled names just as extract_names() does.&lt;br /&gt;
&lt;br /&gt;
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names&lt;br /&gt;
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance&lt;br /&gt;
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.&lt;br /&gt;
&lt;br /&gt;
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.&lt;br /&gt;
&lt;br /&gt;
This function sets the Vancouver error when a required comma is missing and when there is a space between an author&#039;s initials.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function parse_vauthors_veditors (args, vparam, list_name)&lt;br /&gt;
	local names = {};															-- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=&lt;br /&gt;
	local v_name_table = {};&lt;br /&gt;
	local v_link_table = {};													-- when name is wikilinked, targets go in this table&lt;br /&gt;
	local etal = false;															-- return value set to true when we find some form of et al. vauthors parameter&lt;br /&gt;
	local last, first, link, mask, suffix;&lt;br /&gt;
	local corporate = false;&lt;br /&gt;
&lt;br /&gt;
	vparam, etal = name_has_etal (vparam, etal, true);							-- find and remove variations on et al. do not categorize (do it here because et al. might have a period)&lt;br /&gt;
	v_name_table = get_v_name_table (vparam, v_name_table, v_link_table);		-- names are separated by commas&lt;br /&gt;
&lt;br /&gt;
	for i, v_name in ipairs(v_name_table) do&lt;br /&gt;
		first = &#039;&#039;;																-- set to empty string for concatenation and because it may have been set for previous author/editor&lt;br /&gt;
		local accept_name;&lt;br /&gt;
		v_name, accept_name = utilities.has_accept_as_written (v_name);			-- remove accept-this-as-written markup when it wraps all of &amp;lt;v_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		if accept_name then&lt;br /&gt;
			last = v_name;&lt;br /&gt;
			corporate = true;													-- flag used in list_people()&lt;br /&gt;
		elseif string.find(v_name, &amp;quot;%s&amp;quot;) then&lt;br /&gt;
			if v_name:find(&#039;[;%.]&#039;) then										-- look for commonly occurring punctuation characters; &lt;br /&gt;
				add_vanc_error (cfg.err_msg_supl.punctuation, i);&lt;br /&gt;
			end&lt;br /&gt;
			local lastfirstTable = {}&lt;br /&gt;
			lastfirstTable = mw.text.split(v_name, &amp;quot;%s+&amp;quot;)&lt;br /&gt;
			first = table.remove(lastfirstTable);								-- removes and returns value of last element in table which should be initials or generational suffix&lt;br /&gt;
&lt;br /&gt;
			if not mw.ustring.match (first, &#039;^%u+$&#039;) then						-- mw.ustring here so that later we will catch non-Latin characters&lt;br /&gt;
				suffix = first;													-- not initials so assume that whatever we got is a generational suffix&lt;br /&gt;
				first = table.remove(lastfirstTable);							-- get what should be the initials from the table&lt;br /&gt;
			end&lt;br /&gt;
			last = table.concat(lastfirstTable, &#039; &#039;)							-- returns a string that is the concatenation of all other names that are not initials and generational suffix&lt;br /&gt;
			if not utilities.is_set (last) then&lt;br /&gt;
				first = &#039;&#039;;														-- unset&lt;br /&gt;
				last = v_name;													-- last empty because something wrong with first&lt;br /&gt;
				add_vanc_error (cfg.err_msg_supl.name, i);&lt;br /&gt;
			end&lt;br /&gt;
			if mw.ustring.match (last, &#039;%a+%s+%u+%s+%a+&#039;) then&lt;br /&gt;
				add_vanc_error (cfg.err_msg_supl[&#039;missing comma&#039;], i);			-- matches last II last; the case when a comma is missing&lt;br /&gt;
			end&lt;br /&gt;
			if mw.ustring.match (v_name, &#039; %u %u$&#039;) then						-- this test is in the wrong place TODO: move or replace with a more appropriate test&lt;br /&gt;
				add_vanc_error (cfg.err_msg_supl.initials, i);					-- matches a space between two initials&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			last = v_name;														-- last name or single corporate name?  Doesn&#039;t support multiword corporate names? do we need this?&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if utilities.is_set (first) then&lt;br /&gt;
			if not mw.ustring.match (first, &amp;quot;^%u?%u$&amp;quot;) then						-- first shall contain one or two upper-case letters, nothing else&lt;br /&gt;
				add_vanc_error (cfg.err_msg_supl.initials, i);					-- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials&lt;br /&gt;
			end&lt;br /&gt;
			is_good_vanc_name (last, first, suffix, i);							-- check first and last before restoring the suffix which may have a non-Latin digit&lt;br /&gt;
			if utilities.is_set (suffix) then&lt;br /&gt;
				first = first .. &#039; &#039; .. suffix;									-- if there was a suffix concatenate with the initials&lt;br /&gt;
				suffix = &#039;&#039;;													-- unset so we don&#039;t add this suffix to all subsequent names&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			if not corporate then&lt;br /&gt;
				is_good_vanc_name (last, &#039;&#039;, nil, i);&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		link = utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Link&#039;], &#039;err_redundant_parameters&#039;, i ) or v_link_table[i];&lt;br /&gt;
		mask = utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Mask&#039;], &#039;err_redundant_parameters&#039;, i );&lt;br /&gt;
		names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate};		-- add this assembled name to our names list&lt;br /&gt;
	end&lt;br /&gt;
	return names, etal;															-- all done, return our list of names&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E &amp;gt;------------------------&lt;br /&gt;
&lt;br /&gt;
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or&lt;br /&gt;
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.&lt;br /&gt;
&lt;br /&gt;
Only one of these appropriate three will be used.  The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;&lt;br /&gt;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)&lt;br /&gt;
&lt;br /&gt;
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second&lt;br /&gt;
test which mimicks the test used in extract_names() when looking for a hole in the author name list.  There may be a better&lt;br /&gt;
way to do this, I just haven&#039;t discovered what that way is.&lt;br /&gt;
&lt;br /&gt;
Emits an error message when more than one xxxxor name source is provided.&lt;br /&gt;
&lt;br /&gt;
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)&lt;br /&gt;
	local lastfirst = false;&lt;br /&gt;
	if utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Last&#039;], &#039;none&#039;, 1 ) or		-- do this twice in case we have a |first1= without a |last1=; this ...&lt;br /&gt;
		utilities.select_one ( args, cfg.aliases[list_name .. &#039;-First&#039;], &#039;none&#039;, 1 ) or		-- ... also catches the case where |first= is used with |vauthors=&lt;br /&gt;
		utilities.select_one ( args, cfg.aliases[list_name .. &#039;-Last&#039;], &#039;none&#039;, 2 ) or&lt;br /&gt;
		utilities.select_one ( args, cfg.aliases[list_name .. &#039;-First&#039;], &#039;none&#039;, 2 ) then&lt;br /&gt;
			lastfirst = true;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (utilities.is_set (vxxxxors) and true == lastfirst) or					-- these are the three error conditions&lt;br /&gt;
		(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or&lt;br /&gt;
		(true == lastfirst and utilities.is_set (xxxxors)) then&lt;br /&gt;
			local err_name;&lt;br /&gt;
			if &#039;AuthorList&#039; == list_name then									-- figure out which name should be used in error message&lt;br /&gt;
				err_name = &#039;author&#039;;&lt;br /&gt;
			else&lt;br /&gt;
				err_name = &#039;editor&#039;;&lt;br /&gt;
			end&lt;br /&gt;
			utilities.set_message (&#039;err_redundant_parameters&#039;, err_name .. &#039;-name-list parameters&#039;);	-- add error message&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if true == lastfirst then return 1 end;										-- return a number indicating which author name source to use&lt;br /&gt;
	if utilities.is_set (vxxxxors) then return 2 end;&lt;br /&gt;
	if utilities.is_set (xxxxors) then return 3 end;&lt;br /&gt;
	return 1;																	-- no authors so return 1; this allows missing author name test to run in case there is a first without last &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ V A L I D _ P A R A M E T E R _ V A L U E &amp;gt;------------------------------&lt;br /&gt;
&lt;br /&gt;
This function is used to validate a parameter&#039;s assigned value for those parameters that have only a limited number&lt;br /&gt;
of allowable values (yes, y, true, live, dead, etc.).  When the parameter value has not been assigned a value (missing&lt;br /&gt;
or empty in the source template) the function returns the value specified by ret_val.  If the parameter value is one&lt;br /&gt;
of the list of allowed values returns the translated value; else, emits an error message and returns the value&lt;br /&gt;
specified by ret_val.&lt;br /&gt;
&lt;br /&gt;
TODO: explain &amp;lt;invert&amp;gt;&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_valid_parameter_value (value, name, possible, ret_val, invert)&lt;br /&gt;
	if not utilities.is_set (value) then&lt;br /&gt;
		return ret_val;															-- an empty parameter is ok&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (not invert and utilities.in_array (value, possible)) then				-- normal; &amp;lt;value&amp;gt; is in &amp;lt;possible&amp;gt; table&lt;br /&gt;
		return cfg.keywords_xlate[value];										-- return translation of parameter keyword&lt;br /&gt;
	elseif invert and not utilities.in_array (value, possible) then				-- invert; &amp;lt;value&amp;gt; is not in &amp;lt;possible&amp;gt; table&lt;br /&gt;
		return value;															-- return &amp;lt;value&amp;gt; as it is&lt;br /&gt;
	else&lt;br /&gt;
		utilities.set_message (&#039;err_invalid_param_val&#039;, {name, value});			-- not an allowed value so add error message&lt;br /&gt;
		return ret_val;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; T E R M I N A T E _ N A M E _ L I S T &amp;gt;----------------------------------------&lt;br /&gt;
&lt;br /&gt;
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space&lt;br /&gt;
when the last character is not a sepc character or when the last three characters are not sepc followed by two&lt;br /&gt;
closing square brackets (close of a wikilink).  When either of these is true, the name_list is terminated with a&lt;br /&gt;
single space character.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function terminate_name_list (name_list, sepc)&lt;br /&gt;
	if (string.sub (name_list, -3, -1) == sepc .. &#039;. &#039;) then					-- if already properly terminated&lt;br /&gt;
		return name_list;														-- just return the name list&lt;br /&gt;
	elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. &#039;]]&#039;) then	-- if last name in list ends with sepc char&lt;br /&gt;
		return name_list .. &amp;quot; &amp;quot;;												-- don&#039;t add another&lt;br /&gt;
	else&lt;br /&gt;
		return name_list .. sepc .. &#039; &#039;;										-- otherwise terminate the name list&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-------------------------&amp;lt; F O R M A T _ V O L U M E _ I S S U E &amp;gt;-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single&lt;br /&gt;
string; or formatted volume or formatted issue, or an empty string if neither are set.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
	&lt;br /&gt;
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)&lt;br /&gt;
	if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then&lt;br /&gt;
		return &#039;&#039;;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- same condition as in format_pages_sheets()&lt;br /&gt;
	local is_journal = &#039;journal&#039; == cite_class or (utilities.in_array (cite_class, {&#039;citation&#039;, &#039;map&#039;, &#039;interview&#039;}) and &#039;journal&#039; == origin);&lt;br /&gt;
&lt;br /&gt;
	local is_numeric_vol = volume and (volume:match (&#039;^[MDCLXVI]+$&#039;) or volume:match (&#039;^%d+$&#039;));	-- is only uppercase roman numerals or only digits?&lt;br /&gt;
	local is_long_vol = volume and (4 &amp;lt; mw.ustring.len(volume));				-- is |volume= value longer than 4 characters?&lt;br /&gt;
	&lt;br /&gt;
	if volume and (not is_numeric_vol and is_long_vol) then						-- when not all digits or Roman numerals, is |volume= longer than 4 characters?&lt;br /&gt;
		utilities.add_prop_cat (&#039;long-vol&#039;);									-- yes, add properties cat&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if is_journal then															-- journal-style formatting&lt;br /&gt;
		local vol = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (volume) then&lt;br /&gt;
			if is_numeric_vol then												-- |volume= value all digits or all uppercase Roman numerals?&lt;br /&gt;
				vol = utilities.substitute (cfg.presentation[&#039;vol-bold&#039;], {sepc, volume});	-- render in bold face&lt;br /&gt;
			elseif is_long_vol then												-- not all digits or Roman numerals; longer than 4 characters?&lt;br /&gt;
				vol = utilities.substitute (cfg.messages[&#039;j-vol&#039;], {sepc, utilities.hyphen_to_dash (volume)});	-- not bold&lt;br /&gt;
			else																-- four or fewer characters&lt;br /&gt;
				vol = utilities.substitute (cfg.presentation[&#039;vol-bold&#039;], {sepc, utilities.hyphen_to_dash (volume)});	-- bold&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages[&#039;j-issue&#039;], issue) or &#039;&#039;)&lt;br /&gt;
		vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages[&#039;j-article-num&#039;], article) or &#039;&#039;)&lt;br /&gt;
		return vol;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if &#039;podcast&#039; == cite_class and utilities.is_set (issue) then&lt;br /&gt;
		return wrap_msg (&#039;issue&#039;, {sepc, issue}, lower);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if &#039;conference&#039; == cite_class and utilities.is_set (article) then			-- |article-number= supported only in journal and conference cites&lt;br /&gt;
		if utilities.is_set (volume) and utilities.is_set (article) then		-- both volume and article number&lt;br /&gt;
			return wrap_msg (&#039;vol-art&#039;, {sepc, utilities.hyphen_to_dash (volume), article}, lower);&lt;br /&gt;
		elseif utilities.is_set (article) then									-- article number alone; when volume alone, handled below&lt;br /&gt;
			return wrap_msg (&#039;art&#039;, {sepc, article}, lower);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- all other types of citation&lt;br /&gt;
	if utilities.is_set (volume) and utilities.is_set (issue) then&lt;br /&gt;
		return wrap_msg (&#039;vol-no&#039;, {sepc, utilities.hyphen_to_dash (volume), issue}, lower);&lt;br /&gt;
	elseif utilities.is_set (volume) then&lt;br /&gt;
		return wrap_msg (&#039;vol&#039;, {sepc, utilities.hyphen_to_dash (volume)}, lower);&lt;br /&gt;
	else&lt;br /&gt;
		return wrap_msg (&#039;issue&#039;, {sepc, issue}, lower);&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[-------------------------&amp;lt; F O R M A T _ P A G E S _ S H E E T S &amp;gt;-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.&lt;br /&gt;
The return order is:&lt;br /&gt;
	page, pages, sheet, sheets&lt;br /&gt;
&lt;br /&gt;
Singular has priority over plural when both are provided.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)&lt;br /&gt;
	if &#039;map&#039; == cite_class then													-- only cite map supports sheet(s) as in-source locators&lt;br /&gt;
		if utilities.is_set (sheet) then&lt;br /&gt;
			if &#039;journal&#039; == origin then&lt;br /&gt;
				return &#039;&#039;, &#039;&#039;, wrap_msg (&#039;j-sheet&#039;, sheet, lower), &#039;&#039;;&lt;br /&gt;
			else&lt;br /&gt;
				return &#039;&#039;, &#039;&#039;, wrap_msg (&#039;sheet&#039;, {sepc, sheet}, lower), &#039;&#039;;&lt;br /&gt;
			end&lt;br /&gt;
		elseif utilities.is_set (sheets) then&lt;br /&gt;
			if &#039;journal&#039; == origin then&lt;br /&gt;
				return &#039;&#039;, &#039;&#039;, &#039;&#039;, wrap_msg (&#039;j-sheets&#039;, sheets, lower);&lt;br /&gt;
			else&lt;br /&gt;
				return &#039;&#039;, &#039;&#039;, &#039;&#039;, wrap_msg (&#039;sheets&#039;, {sepc, sheets}, lower);&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local is_journal = &#039;journal&#039; == cite_class or (utilities.in_array (cite_class, {&#039;citation&#039;, &#039;map&#039;, &#039;interview&#039;}) and &#039;journal&#039; == origin);&lt;br /&gt;
	&lt;br /&gt;
	if utilities.is_set (page) then&lt;br /&gt;
		if is_journal then&lt;br /&gt;
			return utilities.substitute (cfg.messages[&#039;j-page(s)&#039;], page), &#039;&#039;, &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		elseif not nopp then&lt;br /&gt;
			return utilities.substitute (cfg.messages[&#039;p-prefix&#039;], {sepc, page}), &#039;&#039;, &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		else&lt;br /&gt;
			return utilities.substitute (cfg.messages[&#039;nopp&#039;], {sepc, page}), &#039;&#039;, &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (pages) then&lt;br /&gt;
		if is_journal then&lt;br /&gt;
			return utilities.substitute (cfg.messages[&#039;j-page(s)&#039;], pages), &#039;&#039;, &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		elseif tonumber(pages) ~= nil and not nopp then							-- if pages is only digits, assume a single page number&lt;br /&gt;
			return &#039;&#039;, utilities.substitute (cfg.messages[&#039;p-prefix&#039;], {sepc, pages}), &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		elseif not nopp then&lt;br /&gt;
			return &#039;&#039;, utilities.substitute (cfg.messages[&#039;pp-prefix&#039;], {sepc, pages}), &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		else&lt;br /&gt;
			return &#039;&#039;, utilities.substitute (cfg.messages[&#039;nopp&#039;], {sepc, pages}), &#039;&#039;, &#039;&#039;;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return &#039;&#039;, &#039;&#039;, &#039;&#039;, &#039;&#039;;														-- return empty strings&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I N S O U R C E _ L O C _ G E T &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
returns one of the in-source locators: page, pages, or at. &lt;br /&gt;
&lt;br /&gt;
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text&lt;br /&gt;
for use in COinS.  This COinS thing is done because here we convert an interwiki-link to an external link and&lt;br /&gt;
add an icon span around that; get_coins_pages() doesn&#039;t know about the span.  TODO: should it?  &lt;br /&gt;
&lt;br /&gt;
TODO: add support for sheet and sheets?; streamline;&lt;br /&gt;
&lt;br /&gt;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned&lt;br /&gt;
to a new name)?&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function insource_loc_get (page, page_orig, pages, pages_orig, at)&lt;br /&gt;
	local ws_url, ws_label, coins_pages, L;										-- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (page) then&lt;br /&gt;
		if utilities.is_set (pages) or utilities.is_set (at) then&lt;br /&gt;
			pages = &#039;&#039;;															-- unset the others&lt;br /&gt;
			at = &#039;&#039;;&lt;br /&gt;
		end&lt;br /&gt;
		extra_text_in_page_check (page, page_orig);								-- emit error message when |page= value begins with what looks like p., pp., etc.&lt;br /&gt;
&lt;br /&gt;
		ws_url, ws_label, L = wikisource_url_make (page);						-- make ws URL from |page= interwiki link; link portion L becomes tooltip label&lt;br /&gt;
		if ws_url then&lt;br /&gt;
			page = external_link (ws_url, ws_label .. &#039;&amp;amp;nbsp;&#039;, &#039;ws link in page&#039;);	-- space char after label to move icon away from in-source text; TODO: a better way to do this?&lt;br /&gt;
			page = utilities.substitute (cfg.presentation[&#039;interwiki-icon&#039;], {cfg.presentation[&#039;class-wikisource&#039;], L, page});&lt;br /&gt;
			coins_pages = ws_label;&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (pages) then&lt;br /&gt;
		if utilities.is_set (at) then&lt;br /&gt;
			at = &#039;&#039;;															-- unset&lt;br /&gt;
		end&lt;br /&gt;
		extra_text_in_page_check (pages, pages_orig);							-- emit error message when |page= value begins with what looks like p., pp., etc.&lt;br /&gt;
&lt;br /&gt;
		ws_url, ws_label, L = wikisource_url_make (pages);						-- make ws URL from |pages= interwiki link; link portion L becomes tooltip label&lt;br /&gt;
		if ws_url then&lt;br /&gt;
			pages = external_link (ws_url, ws_label .. &#039;&amp;amp;nbsp;&#039;, &#039;ws link in pages&#039;);	-- space char after label to move icon away from in-source text; TODO: a better way to do this?&lt;br /&gt;
			pages = utilities.substitute (cfg.presentation[&#039;interwiki-icon&#039;], {cfg.presentation[&#039;class-wikisource&#039;], L, pages});&lt;br /&gt;
			coins_pages = ws_label;&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (at) then&lt;br /&gt;
		ws_url, ws_label, L = wikisource_url_make (at);							-- make ws URL from |at= interwiki link; link portion L becomes tooltip label&lt;br /&gt;
		if ws_url then&lt;br /&gt;
			at = external_link (ws_url, ws_label .. &#039;&amp;amp;nbsp;&#039;, &#039;ws link in at&#039;);	-- space char after label to move icon away from in-source text; TODO: a better way to do this?&lt;br /&gt;
			at = utilities.substitute (cfg.presentation[&#039;interwiki-icon&#039;], {cfg.presentation[&#039;class-wikisource&#039;], L, at});&lt;br /&gt;
			coins_pages = ws_label;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return page, pages, at, coins_pages;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ U N I Q U E _ A R C H I V E _ U R L &amp;gt;------------------------------------&lt;br /&gt;
&lt;br /&gt;
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_unique_archive_url (archive, url, c_url, source, date)&lt;br /&gt;
	if utilities.is_set (archive) then&lt;br /&gt;
		if archive == url or archive == c_url then&lt;br /&gt;
			utilities.set_message (&#039;err_bad_url&#039;, {utilities.wrap_style (&#039;parameter&#039;, source)});	-- add error message&lt;br /&gt;
			return &#039;&#039;, &#039;&#039;;														-- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return archive, date;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; A R C H I V E _ U R L _ C H E C K &amp;gt;--------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the &lt;br /&gt;
save snapshot URL or to calendar pages.  When the archive URL is &#039;https://web.archive.org/save/&#039; (or http://...)&lt;br /&gt;
archive.org saves a snapshot of the target page in the URL.  That is something that Wikipedia should not allow&lt;br /&gt;
unwitting readers to do.&lt;br /&gt;
&lt;br /&gt;
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own&lt;br /&gt;
algorithm or provides a calendar &#039;search&#039; result.  [[WP:ELNO]] discourages links to search results.&lt;br /&gt;
&lt;br /&gt;
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and&lt;br /&gt;
|archive-date= and an error message when:&lt;br /&gt;
	|archive-url= holds an archive.org save command URL&lt;br /&gt;
	|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the&lt;br /&gt;
		correct place&lt;br /&gt;
otherwise returns |archive-url= and |archive-date=&lt;br /&gt;
&lt;br /&gt;
There are two mostly compatible archive.org URLs:&lt;br /&gt;
	//web.archive.org/&amp;lt;timestamp&amp;gt;...		-- the old form&lt;br /&gt;
	//web.archive.org/web/&amp;lt;timestamp&amp;gt;...	-- the new form&lt;br /&gt;
&lt;br /&gt;
The old form does not support or map to the new form when it contains a display flag.  There are four identified flags&lt;br /&gt;
(&#039;id_&#039;, &#039;js_&#039;, &#039;cs_&#039;, &#039;im_&#039;) but since archive.org ignores others following the same form (two letters and an underscore)&lt;br /&gt;
we don&#039;t check for these specific flags but we do check the form.&lt;br /&gt;
&lt;br /&gt;
This function supports a preview mode.  When the article is rendered in preview mode, this function may return a modified&lt;br /&gt;
archive URL:&lt;br /&gt;
	for save command errors, return undated wildcard (/*/)&lt;br /&gt;
	for timestamp errors when the timestamp has a wildcard, return the URL unmodified&lt;br /&gt;
	for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)&lt;br /&gt;
&lt;br /&gt;
A secondary function is to return an archive-url timestamp from those urls that have them (archive.org and&lt;br /&gt;
archive.today).  The timestamp is used by validation.archive_date_check() to see if the value in |archive-date=&lt;br /&gt;
matches the timestamp in the archive url.&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function archive_url_check (url, date)&lt;br /&gt;
	local err_msg = &#039;&#039;;															-- start with the error message empty&lt;br /&gt;
	local path, timestamp, flag;												-- portions of the archive.org URL&lt;br /&gt;
	&lt;br /&gt;
	timestamp = url:match (&#039;//archive.today/(%d%d%d%d%d%d%d%d%d%d%d%d%d%d)/&#039;) or	-- get timestamp from archive.today urls&lt;br /&gt;
		url:match (&#039;//archive.today/(%d%d%d%d%.%d%d%.%d%d%-%d%d%d%d%d%d)/&#039;);		-- this timestamp needs cleanup&lt;br /&gt;
	if timestamp then															-- if this was an archive.today url ...&lt;br /&gt;
		return url, date, timestamp:gsub (&#039;[%.%-]&#039;, &#039;&#039;);						-- return ArchiveURL, ArchiveDate, and timestamp (dots and dashes removed) from |archive-url=, and done&lt;br /&gt;
	end&lt;br /&gt;
																				-- here for archive.org urls&lt;br /&gt;
	if (not url:match(&#039;//web%.archive%.org/&#039;)) and (not url:match(&#039;//liveweb%.archive%.org/&#039;)) then		-- also deprecated liveweb Wayback machine URL&lt;br /&gt;
		return url, date;														-- not an archive.org archive, return ArchiveURL and ArchiveDate&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if url:match(&#039;//web%.archive%.org/save/&#039;) then								-- if a save command URL, we don&#039;t want to allow saving of the target page &lt;br /&gt;
		err_msg = cfg.err_msg_supl.save;&lt;br /&gt;
		url = url:gsub (&#039;(//web%.archive%.org)/save/&#039;, &#039;%1/*/&#039;, 1);				-- for preview mode: modify ArchiveURL&lt;br /&gt;
	elseif url:match(&#039;//liveweb%.archive%.org/&#039;) then&lt;br /&gt;
		err_msg = cfg.err_msg_supl.liveweb;&lt;br /&gt;
	else&lt;br /&gt;
		path, timestamp, flag = url:match(&#039;//web%.archive%.org/([^%d]*)(%d+)([^/]*)/&#039;);	-- split out some of the URL parts for evaluation&lt;br /&gt;
		if not path then														-- malformed in some way; pattern did not match&lt;br /&gt;
			err_msg = cfg.err_msg_supl.timestamp;&lt;br /&gt;
		elseif 14 ~= timestamp:len() then										-- path and flag optional, must have 14-digit timestamp here&lt;br /&gt;
			err_msg = cfg.err_msg_supl.timestamp;&lt;br /&gt;
			if &#039;*&#039; ~= flag then&lt;br /&gt;
				local replacement = timestamp:match (&#039;^%d%d%d%d%d%d&#039;) or timestamp:match (&#039;^%d%d%d%d&#039;);	-- get the first 6 (YYYYMM) or first 4 digits (YYYY)&lt;br /&gt;
				if replacement then												-- nil if there aren&#039;t at least 4 digits (year)&lt;br /&gt;
					replacement = replacement .. string.rep (&#039;0&#039;, 14 - replacement:len());	-- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp&lt;br /&gt;
					url=url:gsub (&#039;(//web%.archive%.org/[^%d]*)%d[^/]*&#039;, &#039;%1&#039; .. replacement .. &#039;*&#039;, 1)	-- for preview, modify ts to 14 digits plus splat for calendar display&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		elseif utilities.is_set (path) and &#039;web/&#039; ~= path then					-- older archive URLs do not have the extra &#039;web/&#039; path element&lt;br /&gt;
			err_msg = cfg.err_msg_supl.path;&lt;br /&gt;
		elseif utilities.is_set (flag) and not utilities.is_set (path) then		-- flag not allowed with the old form URL (without the &#039;web/&#039; path element)&lt;br /&gt;
			err_msg = cfg.err_msg_supl.flag;&lt;br /&gt;
		elseif utilities.is_set (flag) and not flag:match (&#039;%a%a_&#039;) then		-- flag if present must be two alpha characters and underscore (requires &#039;web/&#039; path element)&lt;br /&gt;
			err_msg = cfg.err_msg_supl.flag;&lt;br /&gt;
		else&lt;br /&gt;
			return url, date, timestamp;										-- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
																				-- if here, something not right so&lt;br /&gt;
	utilities.set_message (&#039;err_archive_url&#039;, {err_msg});						-- add error message and&lt;br /&gt;
&lt;br /&gt;
	if is_preview_mode then&lt;br /&gt;
		return url, date, timestamp;											-- preview mode so return ArchiveURL, ArchiveDate, and timestamp from |archive-url=&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;&#039;, &#039;&#039;;															-- return empty strings for ArchiveURL and ArchiveDate&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; P L A C E _ C H E C K &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
check |place=, |publication-place=, |location= to see if these params include digits.  This function added because&lt;br /&gt;
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)&lt;br /&gt;
&lt;br /&gt;
returns the original parameter value without modification; added maint cat when parameter value contains digits&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function place_check (param_val)&lt;br /&gt;
	if not utilities.is_set (param_val) then									-- parameter empty or omitted&lt;br /&gt;
		return param_val;														-- return that empty state&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if mw.ustring.find (param_val, &#039;%d&#039;) then									-- not empty, are there digits in the parameter value&lt;br /&gt;
		utilities.set_message (&#039;maint_location&#039;);								-- yep, add maint cat&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return param_val;															-- and done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ A R C H I V E D _ C O P Y &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
compares |title= to &#039;Archived copy&#039; (placeholder added by bots that can&#039;t find proper title); if matches, return true; nil else&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_archived_copy (title)&lt;br /&gt;
	title = mw.ustring.lower(title);											-- switch title to lower case&lt;br /&gt;
	if title:find (cfg.special_case_translation.archived_copy.en) then			-- if title is &#039;Archived copy&#039;&lt;br /&gt;
		return true;&lt;br /&gt;
	elseif cfg.special_case_translation.archived_copy[&#039;local&#039;] then&lt;br /&gt;
		if mw.ustring.find (title, cfg.special_case_translation.archived_copy[&#039;local&#039;]) then	-- mw.ustring() because might not be Latin script&lt;br /&gt;
			return true;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; D I S P L A Y _ N A M E S _ S E L E C T &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
for any of the |display-authors=, |display-editors=, etc parameters, select either the local or global setting.&lt;br /&gt;
When both are present, look at &amp;lt;local_display_names&amp;gt; value.  When the value is some sort of &#039;et al.&#039;string,&lt;br /&gt;
special handling is required.&lt;br /&gt;
&lt;br /&gt;
When {{cs1 config}} has |display-&amp;lt;namelist&amp;gt;= AND this template has |display-&amp;lt;namelist&amp;gt;=etal AND:&lt;br /&gt;
	the number of names specified by &amp;lt;number_of_names&amp;gt; is:&lt;br /&gt;
		greater than the number specified in the global |display-&amp;lt;namelist&amp;gt;= parameter (&amp;lt;global_display_names&amp;gt;)&lt;br /&gt;
			use global |display-&amp;lt;namelist&amp;gt;= parameter value&lt;br /&gt;
			set overridden maint category&lt;br /&gt;
		less than or equal to the number specified in the global |display-&amp;lt;namelist&amp;gt;=  parameter&lt;br /&gt;
			use local |display-&amp;lt;namelist&amp;gt;= parameter value&lt;br /&gt;
&lt;br /&gt;
The purpose of this function is to prevent categorizing a template that has fewer names than the global setting&lt;br /&gt;
to keep the etal annotation specified by &amp;lt;local_display_names&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function display_names_select (global_display_names, local_display_names, param_name, number_of_names, test)&lt;br /&gt;
	if global_display_names and utilities.is_set (local_display_names) then		-- when both&lt;br /&gt;
		if &#039;etal&#039; == local_display_names:lower():gsub(&amp;quot;[ &#039;%.]&amp;quot;, &#039;&#039;) then		-- the :gsub() portion makes &#039;etal&#039; from a variety of &#039;et al.&#039; spellings and stylings&lt;br /&gt;
			number_of_names = tonumber (number_of_names);						-- convert these to numbers for comparison&lt;br /&gt;
			local global_display_names_num = tonumber (global_display_names);	-- &amp;lt;global_display_names&amp;gt; not set when parameter value is not digits&lt;br /&gt;
&lt;br /&gt;
			if number_of_names &amp;gt; global_display_names_num then					-- template has more names than global config allows to be displayed?&lt;br /&gt;
				utilities.set_message (&#039;maint_overridden_setting&#039;);				-- set a maint message because global is overriding local |display-&amp;lt;namelist&amp;gt;=etal&lt;br /&gt;
				return global_display_names, &#039;cs1 config&#039;;						-- return global with spoof parameter name (for get_display_names())&lt;br /&gt;
			else&lt;br /&gt;
				return local_display_names, param_name;							-- return local because fewer names so let &amp;lt;local_display_names&amp;gt; control&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
																				-- here when &amp;lt;global_display_names&amp;gt; and &amp;lt;local_display_names&amp;gt; both numbers; &amp;lt;global_display_names&amp;gt; controls&lt;br /&gt;
		utilities.set_message (&#039;maint_overridden_setting&#039;);						-- set a maint message&lt;br /&gt;
		return global_display_names, &#039;cs1 config&#039;;								-- return global with spoof parameter name (for get_display_names())&lt;br /&gt;
	end&lt;br /&gt;
																				-- here when only one of &amp;lt;global_display_names&amp;gt; or &amp;lt;local_display_names&amp;gt; set&lt;br /&gt;
	if global_display_names then&lt;br /&gt;
		return global_display_names, &#039;cs1 config&#039;;								-- return global with spoof parameter name (for get_display_names())&lt;br /&gt;
	else&lt;br /&gt;
		return local_display_names, param_name;									-- return local&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M O D E _ S E T &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
fetch global mode setting from {{cs1 config}} (if present) or from |mode= (if present); global setting overrides&lt;br /&gt;
local |mode= parameter value.  When both are present, emit maintenance message&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function mode_set (Mode, Mode_origin)&lt;br /&gt;
	local mode;&lt;br /&gt;
	if cfg.global_cs1_config_t[&#039;Mode&#039;] then										-- global setting in {{cs1 config}}; nil when empty or assigned value invalid&lt;br /&gt;
		mode = is_valid_parameter_value (cfg.global_cs1_config_t[&#039;Mode&#039;], &#039;cs1 config: mode&#039;, cfg.keywords_lists[&#039;mode&#039;], &#039;&#039;);	-- error messaging &#039;param&#039; here is a hoax&lt;br /&gt;
	else&lt;br /&gt;
		mode = is_valid_parameter_value (Mode, Mode_origin, cfg.keywords_lists[&#039;mode&#039;], &#039;&#039;);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if cfg.global_cs1_config_t[&#039;Mode&#039;] and utilities.is_set (Mode) then			-- when template has |mode=&amp;lt;something&amp;gt; which global setting has overridden&lt;br /&gt;
		utilities.set_message (&#039;maint_overridden_setting&#039;);						-- set a maint message&lt;br /&gt;
	end&lt;br /&gt;
	return mode;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; Q U O T E _ M A K E &amp;gt;----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
create quotation from |quote=, |trans-quote=, and/or script-quote= with or without |quote-page= or |quote-pages=&lt;br /&gt;
&lt;br /&gt;
when any of those three quote parameters are set, this function unsets &amp;lt;PostScript&amp;gt;.  When none of those parameters&lt;br /&gt;
are set, |quote-page= and |quote-pages= are unset to nil so that they are not included in the template&#039;s metadata&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function quote_make (quote, trans_quote, script_quote, quote_page, quote_pages, nopp, sepc, postscript)&lt;br /&gt;
	if utilities.is_set (quote) or utilities.is_set (trans_quote) or utilities.is_set (script_quote) then&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (quote) then&lt;br /&gt;
			if quote:sub(1, 1) == &#039;&amp;quot;&#039; and quote:sub(-1, -1) == &#039;&amp;quot;&#039; then			-- if first and last characters of quote are quote marks&lt;br /&gt;
				quote = quote:sub(2, -2);										-- strip them off&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		quote = kern_quotes (quote);											-- kern if needed&lt;br /&gt;
		quote = utilities.wrap_style (&#039;quoted-text&#039;, quote );					-- wrap in &amp;lt;q&amp;gt;...&amp;lt;/q&amp;gt; tags&lt;br /&gt;
	&lt;br /&gt;
		if utilities.is_set (script_quote) then&lt;br /&gt;
			quote = script_concatenate (quote, script_quote, &#039;script-quote&#039;);	-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; must be done after quote is wrapped&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (trans_quote) then&lt;br /&gt;
			if trans_quote:sub(1, 1) == &#039;&amp;quot;&#039; and trans_quote:sub(-1, -1) == &#039;&amp;quot;&#039; then -- if first and last characters of |trans-quote are quote marks&lt;br /&gt;
				trans_quote = trans_quote:sub(2, -2); -- strip them off&lt;br /&gt;
			end&lt;br /&gt;
			quote = quote .. &amp;quot; &amp;quot; .. utilities.wrap_style (&#039;trans-quoted-title&#039;, trans_quote );&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (quote_page) or utilities.is_set (quote_pages) then	-- add page prefix&lt;br /&gt;
			local quote_prefix = &#039;&#039;;&lt;br /&gt;
			if utilities.is_set (quote_page) then&lt;br /&gt;
				extra_text_in_page_check (quote_page, &#039;quote-page&#039;);			-- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.&lt;br /&gt;
				if not nopp then&lt;br /&gt;
					quote_prefix = utilities.substitute (cfg.messages[&#039;p-prefix&#039;], {sepc, quote_page}), &#039;&#039;, &#039;&#039;, &#039;&#039;;&lt;br /&gt;
				else&lt;br /&gt;
					quote_prefix = utilities.substitute (cfg.messages[&#039;nopp&#039;], {sepc, quote_page}), &#039;&#039;, &#039;&#039;, &#039;&#039;;&lt;br /&gt;
				end&lt;br /&gt;
			elseif utilities.is_set (quote_pages) then&lt;br /&gt;
				extra_text_in_page_check (quote_pages, &#039;quote-pages&#039;);			-- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.&lt;br /&gt;
				if tonumber(quote_pages) ~= nil and not nopp then				-- if only digits, assume single page&lt;br /&gt;
					quote_prefix = utilities.substitute (cfg.messages[&#039;p-prefix&#039;], {sepc, quote_pages}), &#039;&#039;, &#039;&#039;;&lt;br /&gt;
				elseif not nopp then&lt;br /&gt;
					quote_prefix = utilities.substitute (cfg.messages[&#039;pp-prefix&#039;], {sepc, quote_pages}), &#039;&#039;, &#039;&#039;;&lt;br /&gt;
				else&lt;br /&gt;
					quote_prefix = utilities.substitute (cfg.messages[&#039;nopp&#039;], {sepc, quote_pages}), &#039;&#039;, &#039;&#039;;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
                        &lt;br /&gt;
			quote = quote_prefix .. &amp;quot;: &amp;quot; .. quote;&lt;br /&gt;
		else&lt;br /&gt;
			quote = sepc .. &amp;quot; &amp;quot; .. quote;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		postscript = &amp;quot;&amp;quot;;														-- cs1|2 does not supply terminal punctuation when |quote= is set&lt;br /&gt;
	&lt;br /&gt;
	elseif utilities.is_set (quote_page) or utilities.is_set (quote_pages) then&lt;br /&gt;
		quote_page = nil;														-- unset; these require |quote=; TODO: error message?&lt;br /&gt;
		quote_pages = nil;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return quote, quote_page, quote_pages, postscript;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C H E C K _ P U B L I S H E R _ N A M E &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
look for variations of &#039;&amp;lt;text&amp;gt;: &amp;lt;text&amp;gt;&#039; that might be &#039;&amp;lt;location&amp;gt;: &amp;lt;publisher&amp;gt;&#039; in |publisher= parameter value.&lt;br /&gt;
when found, emit a maintenance message; return nil else&lt;br /&gt;
&lt;br /&gt;
&amp;lt;publisher&amp;gt; is the value assigned to |publisher= or |institution=&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function check_publisher_name (publisher)&lt;br /&gt;
	local patterns_t = {&lt;br /&gt;
		&#039;^[%w%s]+%s*:%s*[%w%s]+$&#039;,												-- plain text &amp;lt;location&amp;gt;: &amp;lt;publisher&amp;gt;&lt;br /&gt;
		&#039;^%[+[%w%s:|]+%]+%s*:%s*[%w%s]+$&#039;,										-- partially wikilinked [[&amp;lt;location&amp;gt;]]: &amp;lt;publisher&amp;gt;&lt;br /&gt;
		&#039;^[%w%s]+%s*:%s*%[+[%w%s:|]+%]+$&#039;,										-- partially wikilinked &amp;lt;location&amp;gt;: [[&amp;lt;publisher&amp;gt;]]&lt;br /&gt;
		&#039;^%[+[%w%s:|]+%]+%s*:%s*%[+[%w%s:|]+%]+$&#039;,								-- wikilinked [[&amp;lt;location&amp;gt;]]: [[&amp;lt;publisher&amp;gt;]]&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
	for _, pattern in ipairs (patterns_t) do									-- spin through the patterns_t sequence&lt;br /&gt;
		if mw.ustring.match (publisher, pattern) then							-- does this pattern match?&lt;br /&gt;
			utilities.set_message (&#039;maint_publisher_location&#039;);					-- set a maint message&lt;br /&gt;
			return;																-- and done&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ P A G E _ A R T _ N U M &amp;gt;------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
compare the trailing (rightmost) characters of the |doi= value against the whole value assigned to |page(s)=.&lt;br /&gt;
&lt;br /&gt;
return boolean true when:&lt;br /&gt;
	|page(s)= has exactly 8 digits and a dot between the fourth and fifth digits matches the trailing 9 characters&lt;br /&gt;
		of the |doi= value: |page=12345678 → |page=1234.5678 matches |doi=10.xxxx/yyyy1234.5678&lt;br /&gt;
	|page(s)= is 5 or more characters and matches |doi= values&#039;s trailing characters&lt;br /&gt;
	|page(s)= begins with a lowercase &#039;e&#039; and |page(s)= without the &#039;e&#039; matches |doi= values&#039;s trailing&lt;br /&gt;
		characters: |page=e12345 → |page=12345 matches |doi=10.xxxx/yyyy12345&lt;br /&gt;
	|page(s)= begins with a uppercase &#039;CD&#039; followed by (typically) six digits matches |doi= values that ends with&lt;br /&gt;
		&#039;CDxxxxxx.pubx&#039; (where &#039;x&#039; is any single digit)&lt;br /&gt;
&lt;br /&gt;
return nil when |page(s)= values:&lt;br /&gt;
	are ranges separated by underscore, hyphen, emdash, endash, figure dash, or minus character&lt;br /&gt;
	are comma- or semicolon-separated lists of pages&lt;br /&gt;
	have external urls (has text &#039;http&#039;)&lt;br /&gt;
	are digit-only values less than 10000&lt;br /&gt;
	do not match |doi= values&#039;s trailing characters&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_page_art_num (page, doi)&lt;br /&gt;
	if not (utilities.is_set (page) and utilities.is_set (doi)) then			-- both required&lt;br /&gt;
		return;																	-- abandon; nothing to do&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if page:match (&#039;[,;_−–—‒%-]&#039;) then											-- when |page(s)= might be a page range or a separated list of pages&lt;br /&gt;
		return;																	-- abandon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	page = page:lower();														-- because doi names are case insensitive&lt;br /&gt;
	doi = doi:lower();															-- force these to lowercase for testing&lt;br /&gt;
	&lt;br /&gt;
	if page:match (&#039;http&#039;) then													-- when |page(s)= appears to hold a url&lt;br /&gt;
		return;																	-- abandon&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if tonumber (page) then														-- is |page(s)= digits only&lt;br /&gt;
		if 10000 &amp;gt; tonumber (page) then											-- when |page(s)= less than 10000&lt;br /&gt;
			return;																-- abandon&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
		if doi:match (page .. &#039;$&#039;) then											-- digits only page number match the last digits in |doi=?&lt;br /&gt;
			return true;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if 8 == page:len() then													-- special case when |page(s)= is exactly 8 digits&lt;br /&gt;
			local dot_page = page:gsub (&#039;(%d%d%d%d)(%d%d%d%d)&#039;, &#039;%1.%2&#039;);		-- make a |page=xxxx.yyyy version commonly used in |doi=&lt;br /&gt;
			if doi:match (dot_page .. &#039;$&#039;) then									-- 8-digit dotted page number match the last characters in |doi=?&lt;br /&gt;
				return true;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
	else																		-- here when |page(s)= is alpha-numeric&lt;br /&gt;
		if 4 &amp;lt; page:len() then													-- when |page(s)= is five or more characters&lt;br /&gt;
			if doi:match (page .. &#039;$&#039;) then										-- alpha-numeric page match the last characters in |doi=?&lt;br /&gt;
				return true;&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			local epage = page:match (&#039;^e([%w]+)$&#039;);							-- if first character of |page= is &#039;e&#039;, remove it&lt;br /&gt;
			if epage and doi:match (epage .. &#039;$&#039;) then							-- page number match the last characters in |doi=?&lt;br /&gt;
				return true;&lt;br /&gt;
			end&lt;br /&gt;
	&lt;br /&gt;
			local cdpage = page:match (&#039;^cd%d+$&#039;);								-- if first characters of |page= are &#039;CD&#039; and last characters are digits (typically 6 digits)&lt;br /&gt;
			if cdpage and doi:match (cdpage .. &#039;%.pub%d$&#039;) then					-- page number matches doi &#039;CDxxxxxx.pubx&#039; where &#039;x&#039; is a digit&lt;br /&gt;
				return true;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C I T A T I O N 0 &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This is the main function doing the majority of the citation formatting.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function citation0( config, args )&lt;br /&gt;
	--[[ &lt;br /&gt;
	Load Input Parameters&lt;br /&gt;
	The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.&lt;br /&gt;
	]]&lt;br /&gt;
	local A = argument_wrapper ( args );&lt;br /&gt;
	local i &lt;br /&gt;
&lt;br /&gt;
	-- Pick out the relevant fields from the arguments.  Different citation templates&lt;br /&gt;
	-- define different field names for the same underlying things.	&lt;br /&gt;
&lt;br /&gt;
	local author_etal;&lt;br /&gt;
	local a	= {};																-- authors list from |lastn= / |firstn= pairs or |vauthors=&lt;br /&gt;
	local Authors;&lt;br /&gt;
	local NameListStyle;&lt;br /&gt;
		if cfg.global_cs1_config_t[&#039;NameListStyle&#039;] then						-- global setting in {{cs1 config}} overrides local |name-list-style= parameter value; nil when empty or assigned value invalid&lt;br /&gt;
			NameListStyle = is_valid_parameter_value (cfg.global_cs1_config_t[&#039;NameListStyle&#039;], &#039;cs1 config: name-list-style&#039;, cfg.keywords_lists[&#039;name-list-style&#039;], &#039;&#039;);	-- error messaging &#039;param&#039; here is a hoax&lt;br /&gt;
		else&lt;br /&gt;
			NameListStyle = is_valid_parameter_value (A[&#039;NameListStyle&#039;], A:ORIGIN(&#039;NameListStyle&#039;), cfg.keywords_lists[&#039;name-list-style&#039;], &#039;&#039;);&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if cfg.global_cs1_config_t[&#039;NameListStyle&#039;] and utilities.is_set (A[&#039;NameListStyle&#039;]) then	-- when template has |name-list-style=&amp;lt;something&amp;gt; which global setting has overridden&lt;br /&gt;
			utilities.set_message (&#039;maint_overridden_setting&#039;);					-- set a maint message&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	local Collaboration = A[&#039;Collaboration&#039;];&lt;br /&gt;
&lt;br /&gt;
	do																			-- to limit scope of selected&lt;br /&gt;
		local selected = select_author_editor_source (A[&#039;Vauthors&#039;], A[&#039;Authors&#039;], args, &#039;AuthorList&#039;);&lt;br /&gt;
		if 1 == selected then&lt;br /&gt;
			a, author_etal = extract_names (args, &#039;AuthorList&#039;);				-- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=&lt;br /&gt;
		elseif 2 == selected then&lt;br /&gt;
			NameListStyle = &#039;vanc&#039;;												-- override whatever |name-list-style= might be&lt;br /&gt;
			a, author_etal = parse_vauthors_veditors (args, A[&#039;Vauthors&#039;], &#039;AuthorList&#039;);	-- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=&lt;br /&gt;
		elseif 3 == selected then&lt;br /&gt;
			Authors = A[&#039;Authors&#039;];												-- use content of |people= or |credits=; |authors= is deprecated; TODO: constrain |people= and |credits= to cite av media, episode, serial?&lt;br /&gt;
		end&lt;br /&gt;
		if utilities.is_set (Collaboration) then&lt;br /&gt;
			author_etal = true;													-- so that |display-authors=etal not required&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local editor_etal;&lt;br /&gt;
	local e	= {};																-- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=&lt;br /&gt;
&lt;br /&gt;
	do																			-- to limit scope of selected&lt;br /&gt;
		local selected = select_author_editor_source (A[&#039;Veditors&#039;], nil, args, &#039;EditorList&#039;);	-- support for |editors= withdrawn&lt;br /&gt;
		if 1 == selected then&lt;br /&gt;
			e, editor_etal = extract_names (args, &#039;EditorList&#039;);				-- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=&lt;br /&gt;
		elseif 2 == selected then&lt;br /&gt;
			NameListStyle = &#039;vanc&#039;;												-- override whatever |name-list-style= might be&lt;br /&gt;
			e, editor_etal = parse_vauthors_veditors (args, args.veditors, &#039;EditorList&#039;);	-- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
							&lt;br /&gt;
	local Chapter = A[&#039;Chapter&#039;];												-- done here so that we have access to |contribution= from |chapter= aliases&lt;br /&gt;
	local Chapter_origin = A:ORIGIN (&#039;Chapter&#039;);&lt;br /&gt;
	local Contribution;															-- because contribution is required for contributor(s)&lt;br /&gt;
		if &#039;contribution&#039; == Chapter_origin then&lt;br /&gt;
			Contribution = Chapter;												-- get the name of the contribution&lt;br /&gt;
		end&lt;br /&gt;
	local c = {};																-- contributors list from |contributor-lastn= / contributor-firstn= pairs&lt;br /&gt;
	&lt;br /&gt;
	if utilities.in_array (config.CitationClass, {&amp;quot;book&amp;quot;, &amp;quot;citation&amp;quot;}) and not utilities.is_set (A[&#039;Periodical&#039;]) then	-- |contributor= and |contribution= only supported in book cites&lt;br /&gt;
		c = extract_names (args, &#039;ContributorList&#039;);							-- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=&lt;br /&gt;
		&lt;br /&gt;
		if 0 &amp;lt; #c then&lt;br /&gt;
			if not utilities.is_set (Contribution) then							-- |contributor= requires |contribution=&lt;br /&gt;
				utilities.set_message (&#039;err_contributor_missing_required_param&#039;, &#039;contribution&#039;);	-- add missing contribution error message&lt;br /&gt;
				c = {};															-- blank the contributors&#039; table; it is used as a flag later&lt;br /&gt;
			end&lt;br /&gt;
			if 0 == #a then														-- |contributor= requires |author=&lt;br /&gt;
				utilities.set_message (&#039;err_contributor_missing_required_param&#039;, &#039;author&#039;);	-- add missing author error message&lt;br /&gt;
				c = {};															-- blank the contributors&#039; table; it is used as a flag later&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else																		-- if not a book cite&lt;br /&gt;
		if utilities.select_one (args, cfg.aliases[&#039;ContributorList-Last&#039;], &#039;err_redundant_parameters&#039;, 1 ) then	-- are there contributor name list parameters?&lt;br /&gt;
			utilities.set_message (&#039;err_contributor_ignored&#039;);					-- add contributor ignored error message&lt;br /&gt;
		end&lt;br /&gt;
		Contribution = nil;														-- unset&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Title = A[&#039;Title&#039;];&lt;br /&gt;
	local TitleLink = A[&#039;TitleLink&#039;];&lt;br /&gt;
&lt;br /&gt;
	local auto_select = &#039;&#039;;														-- default is auto&lt;br /&gt;
	local accept_link;&lt;br /&gt;
	TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true);	-- test for accept-this-as-written markup&lt;br /&gt;
	if (not accept_link) and utilities.in_array (TitleLink, {&#039;none&#039;, &#039;pmc&#039;, &#039;doi&#039;}) then -- check for special keywords&lt;br /&gt;
		auto_select = TitleLink;												-- remember selection for later&lt;br /&gt;
		TitleLink = &#039;&#039;;															-- treat as if |title-link= would have been empty&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	TitleLink = link_title_ok (TitleLink, A:ORIGIN (&#039;TitleLink&#039;), Title, &#039;title&#039;);	-- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set&lt;br /&gt;
&lt;br /&gt;
	local Section = &#039;&#039;;															-- {{cite map}} only; preset to empty string for concatenation if not used&lt;br /&gt;
	if &#039;map&#039; == config.CitationClass and &#039;section&#039; == Chapter_origin then&lt;br /&gt;
		Section = A[&#039;Chapter&#039;];													-- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}&lt;br /&gt;
		Chapter = &#039;&#039;;															-- unset for now; will be reset later from |map= if present&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Periodical = A[&#039;Periodical&#039;];&lt;br /&gt;
	local Periodical_origin = A:ORIGIN(&#039;Periodical&#039;);&lt;br /&gt;
	local ScriptPeriodical = A[&#039;ScriptPeriodical&#039;];&lt;br /&gt;
	local ScriptPeriodical_origin = A:ORIGIN(&#039;ScriptPeriodical&#039;);&lt;br /&gt;
	local TransPeriodical =  A[&#039;TransPeriodical&#039;];&lt;br /&gt;
	local TransPeriodical_origin =  A:ORIGIN (&#039;TransPeriodical&#039;);&lt;br /&gt;
	&lt;br /&gt;
	if (utilities.in_array (config.CitationClass, {&#039;book&#039;, &#039;encyclopaedia&#039;}) and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical))) then&lt;br /&gt;
		local param;&lt;br /&gt;
		if utilities.is_set (Periodical) then									-- get a parameter name from one of these periodical related meta-parameters&lt;br /&gt;
			Periodical = &#039;&#039;;													-- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters &lt;br /&gt;
			param = Periodical_origin											-- get parameter name for error messaging&lt;br /&gt;
		elseif utilities.is_set (TransPeriodical) then&lt;br /&gt;
			TransPeriodical = &#039;&#039;;												-- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters &lt;br /&gt;
			param = TransPeriodical_origin;										-- get parameter name for error messaging&lt;br /&gt;
		elseif utilities.is_set (ScriptPeriodical) then&lt;br /&gt;
			ScriptPeriodical = &#039;&#039;;												-- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters &lt;br /&gt;
			param = ScriptPeriodical_origin;									-- get parameter name for error messaging&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (param) then										-- if we found one&lt;br /&gt;
			utilities.set_message (&#039;err_periodical_ignored&#039;, {param});			-- emit an error message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (Periodical) then&lt;br /&gt;
		local i;&lt;br /&gt;
		Periodical, i = utilities.strip_apostrophe_markup (Periodical);			-- strip apostrophe markup so that metadata isn&#039;t contaminated &lt;br /&gt;
		if i then																-- non-zero when markup was stripped so emit an error message&lt;br /&gt;
			utilities.set_message (&#039;err_apostrophe_markup&#039;, {Periodical_origin});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if &#039;mailinglist&#039; == config.CitationClass then								-- special case for {{cite mailing list}}&lt;br /&gt;
		if utilities.is_set (Periodical) and utilities.is_set (A [&#039;MailingList&#039;]) then	-- both set emit an error TODO: make a function for this and similar?&lt;br /&gt;
			utilities.set_message (&#039;err_redundant_parameters&#039;, {utilities.wrap_style (&#039;parameter&#039;, Periodical_origin) .. cfg.presentation[&#039;sep_list_pair&#039;] .. utilities.wrap_style (&#039;parameter&#039;, &#039;mailinglist&#039;)});&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		Periodical = A [&#039;MailingList&#039;];											-- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}&lt;br /&gt;
		Periodical_origin = A:ORIGIN(&#039;MailingList&#039;);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- web and news not tested for now because of &lt;br /&gt;
	-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_&amp;quot;Cite_Web&amp;quot;_errors?&lt;br /&gt;
	if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then	-- &#039;periodical&#039; templates require periodical parameter&lt;br /&gt;
	--	local p = {[&#039;journal&#039;] = &#039;journal&#039;, [&#039;magazine&#039;] = &#039;magazine&#039;, [&#039;news&#039;] = &#039;newspaper&#039;, [&#039;web&#039;] = &#039;website&#039;};	-- for error message&lt;br /&gt;
		local p = {[&#039;journal&#039;] = &#039;journal&#039;, [&#039;magazine&#039;] = &#039;magazine&#039;};			-- for error message&lt;br /&gt;
		if p[config.CitationClass]  then&lt;br /&gt;
			utilities.set_message (&#039;err_missing_periodical&#039;, {config.CitationClass, p[config.CitationClass]});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local Volume;&lt;br /&gt;
	if &#039;citation&#039; == config.CitationClass then&lt;br /&gt;
		if utilities.is_set (Periodical) then&lt;br /&gt;
			if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then	-- {{citation}} does not render |volume= when these parameters are used&lt;br /&gt;
				Volume = A[&#039;Volume&#039;];											-- but does for all other &#039;periodicals&#039;&lt;br /&gt;
			end&lt;br /&gt;
		elseif utilities.is_set (ScriptPeriodical) then&lt;br /&gt;
			if &#039;script-website&#039; ~= ScriptPeriodical_origin then					-- {{citation}} does not render volume for |script-website=&lt;br /&gt;
				Volume = A[&#039;Volume&#039;];											-- but does for all other &#039;periodicals&#039;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			Volume = A[&#039;Volume&#039;];												-- and does for non-&#039;periodical&#039; cites&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then	-- render |volume= for cs1 according to the configuration settings&lt;br /&gt;
		Volume = A[&#039;Volume&#039;];&lt;br /&gt;
	end	&lt;br /&gt;
	extra_text_in_vol_iss_check (Volume, A:ORIGIN (&#039;Volume&#039;), &#039;v&#039;);	&lt;br /&gt;
&lt;br /&gt;
	local Issue;&lt;br /&gt;
	if &#039;citation&#039; == config.CitationClass then&lt;br /&gt;
		if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then	-- {{citation}} may render |issue= when these parameters are used&lt;br /&gt;
			Issue = utilities.hyphen_to_dash (A[&#039;Issue&#039;]);&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then	-- conference &amp;amp; map books do not support issue; {{citation}} listed here because included in settings table&lt;br /&gt;
		if not (utilities.in_array (config.CitationClass, {&#039;conference&#039;, &#039;map&#039;, &#039;citation&#039;}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then&lt;br /&gt;
			Issue = utilities.hyphen_to_dash (A[&#039;Issue&#039;]);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local ArticleNumber;&lt;br /&gt;
&lt;br /&gt;
	if utilities.in_array (config.CitationClass, {&#039;journal&#039;, &#039;conference&#039;}) or (&#039;citation&#039; == config.CitationClass and utilities.is_set (Periodical) and &#039;journal&#039; == Periodical_origin) then&lt;br /&gt;
		ArticleNumber = A[&#039;ArticleNumber&#039;];&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	extra_text_in_vol_iss_check (Issue, A:ORIGIN (&#039;Issue&#039;), &#039;i&#039;);	&lt;br /&gt;
&lt;br /&gt;
	local Page;&lt;br /&gt;
	local Pages;&lt;br /&gt;
	local At;&lt;br /&gt;
	local QuotePage;&lt;br /&gt;
	local QuotePages;&lt;br /&gt;
	if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then		-- TODO: rewrite to emit ignored parameter error message?&lt;br /&gt;
		Page = A[&#039;Page&#039;];&lt;br /&gt;
		Pages = utilities.hyphen_to_dash (A[&#039;Pages&#039;]);	&lt;br /&gt;
		At = A[&#039;At&#039;];&lt;br /&gt;
		QuotePage = A[&#039;QuotePage&#039;];&lt;br /&gt;
		QuotePages = utilities.hyphen_to_dash (A[&#039;QuotePages&#039;]);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local NoPP = is_valid_parameter_value (A[&#039;NoPP&#039;], A:ORIGIN(&#039;NoPP&#039;), cfg.keywords_lists[&#039;yes_true_y&#039;], nil);&lt;br /&gt;
&lt;br /&gt;
	local Mode = mode_set (A[&#039;Mode&#039;], A:ORIGIN(&#039;Mode&#039;));&lt;br /&gt;
&lt;br /&gt;
	-- separator character and postscript&lt;br /&gt;
	local sepc, PostScript = set_style (Mode:lower(), A[&#039;PostScript&#039;], config.CitationClass);&lt;br /&gt;
	local Quote;&lt;br /&gt;
	Quote, QuotePage, QuotePages, PostScript = quote_make (A[&#039;Quote&#039;], A[&#039;TransQuote&#039;], A[&#039;ScriptQuote&#039;], QuotePage, QuotePages, NoPP, sepc, PostScript);&lt;br /&gt;
&lt;br /&gt;
	local Edition = A[&#039;Edition&#039;];&lt;br /&gt;
	local PublicationPlace = place_check (A[&#039;PublicationPlace&#039;], A:ORIGIN(&#039;PublicationPlace&#039;));&lt;br /&gt;
	local Place = place_check (A[&#039;Place&#039;], A:ORIGIN(&#039;Place&#039;));&lt;br /&gt;
	&lt;br /&gt;
	local PublisherName = A[&#039;PublisherName&#039;];&lt;br /&gt;
	local PublisherName_origin = A:ORIGIN(&#039;PublisherName&#039;);&lt;br /&gt;
	if utilities.is_set (PublisherName) and (cfg.keywords_xlate[&#039;none&#039;] ~= PublisherName) then&lt;br /&gt;
		local i = 0;&lt;br /&gt;
		PublisherName, i = utilities.strip_apostrophe_markup (PublisherName);	-- strip apostrophe markup so that metadata isn&#039;t contaminated; publisher is never italicized&lt;br /&gt;
		if i and (0 &amp;lt; i) then													-- non-zero when markup was stripped so emit an error message&lt;br /&gt;
			utilities.set_message (&#039;err_apostrophe_markup&#039;, {PublisherName_origin});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (&#039;document&#039; == config.CitationClass) and not utilities.is_set (PublisherName) then&lt;br /&gt;
		utilities.set_message (&#039;err_missing_publisher&#039;, {config.CitationClass, &#039;publisher&#039;});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Newsgroup = A[&#039;Newsgroup&#039;];											-- TODO: strip apostrophe markup?&lt;br /&gt;
	local Newsgroup_origin = A:ORIGIN(&#039;Newsgroup&#039;);	&lt;br /&gt;
&lt;br /&gt;
	if &#039;newsgroup&#039; == config.CitationClass then&lt;br /&gt;
		if utilities.is_set (PublisherName) and (cfg.keywords_xlate[&#039;none&#039;] ~= PublisherName) then	-- general use parameter |publisher= not allowed in cite newsgroup&lt;br /&gt;
			utilities.set_message (&#039;err_parameter_ignored&#039;, {PublisherName_origin});&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		PublisherName = nil;													-- ensure that this parameter is unset for the time being; will be used again after COinS&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if &#039;book&#039; == config.CitationClass or &#039;encyclopaedia&#039; == config.CitationClass or (&#039;citation&#039; == config.CitationClass and not utilities.is_set (Periodical)) then&lt;br /&gt;
		local accept;&lt;br /&gt;
		PublisherName, accept = utilities.has_accept_as_written (PublisherName);	-- check for and remove accept-as-written markup from |publisher= wrapped&lt;br /&gt;
		if not accept then														-- when no accept-as-written markup&lt;br /&gt;
			check_publisher_name (PublisherName);								-- emit maint message when |publisher= might be prefixed with publisher&#039;s location&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local URL = A[&#039;URL&#039;];														-- TODO: better way to do this for URL, ChapterURL, and MapURL?&lt;br /&gt;
	local UrlAccess = is_valid_parameter_value (A[&#039;UrlAccess&#039;], A:ORIGIN(&#039;UrlAccess&#039;), cfg.keywords_lists[&#039;url-access&#039;], nil);&lt;br /&gt;
	&lt;br /&gt;
	if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then&lt;br /&gt;
		UrlAccess = nil;&lt;br /&gt;
		utilities.set_message (&#039;err_param_access_requires_param&#039;, &#039;url&#039;);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local ChapterURL = A[&#039;ChapterURL&#039;];&lt;br /&gt;
	local ChapterUrlAccess = is_valid_parameter_value (A[&#039;ChapterUrlAccess&#039;], A:ORIGIN(&#039;ChapterUrlAccess&#039;), cfg.keywords_lists[&#039;url-access&#039;], nil);&lt;br /&gt;
	if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then&lt;br /&gt;
		ChapterUrlAccess = nil;&lt;br /&gt;
		utilities.set_message (&#039;err_param_access_requires_param&#039;, {A:ORIGIN(&#039;ChapterUrlAccess&#039;):gsub (&#039;%-access&#039;, &#039;&#039;)});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local MapUrlAccess = is_valid_parameter_value (A[&#039;MapUrlAccess&#039;], A:ORIGIN(&#039;MapUrlAccess&#039;), cfg.keywords_lists[&#039;url-access&#039;], nil);&lt;br /&gt;
	if not utilities.is_set (A[&#039;MapURL&#039;]) and utilities.is_set (MapUrlAccess) then&lt;br /&gt;
		MapUrlAccess = nil;&lt;br /&gt;
		utilities.set_message (&#039;err_param_access_requires_param&#039;, {&#039;map-url&#039;});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local this_page = mw.title.getCurrentTitle();								-- also used for COinS and for language&lt;br /&gt;
	local no_tracking_cats = is_valid_parameter_value (A[&#039;NoTracking&#039;], A:ORIGIN(&#039;NoTracking&#039;), cfg.keywords_lists[&#039;yes_true_y&#039;], nil);&lt;br /&gt;
&lt;br /&gt;
	-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories&lt;br /&gt;
	if not utilities.is_set (no_tracking_cats) then								-- ignore if we are already not going to categorize this page&lt;br /&gt;
		if cfg.uncategorized_namespaces[this_page.namespace] then				-- is this page&#039;s namespace id one of the uncategorized namespace ids?&lt;br /&gt;
			no_tracking_cats = &amp;quot;true&amp;quot;;											-- set no_tracking_cats&lt;br /&gt;
		end&lt;br /&gt;
		for _, v in ipairs (cfg.uncategorized_subpages) do						-- cycle through page name patterns&lt;br /&gt;
			if this_page.text:match (v) then									-- test page name against each pattern&lt;br /&gt;
				no_tracking_cats = &amp;quot;true&amp;quot;;										-- set no_tracking_cats&lt;br /&gt;
				break;															-- bail out if one is found&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
																				-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we&#039;re at it)&lt;br /&gt;
	utilities.select_one (args, {&#039;page&#039;, &#039;p&#039;, &#039;pp&#039;, &#039;pages&#039;, &#039;at&#039;, &#039;sheet&#039;, &#039;sheets&#039;}, &#039;err_redundant_parameters&#039;);	-- this is a dummy call simply to get the error message and category&lt;br /&gt;
&lt;br /&gt;
	local coins_pages;&lt;br /&gt;
	&lt;br /&gt;
	Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN(&#039;Page&#039;), Pages, A:ORIGIN(&#039;Pages&#039;), At);&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then	-- both |publication-place= and |place= (|location=) allowed if different&lt;br /&gt;
		utilities.add_prop_cat (&#039;location-test&#039;);								-- add property cat to evaluate how often PublicationPlace and Place are used together&lt;br /&gt;
		if PublicationPlace == Place then&lt;br /&gt;
			Place = &#039;&#039;;															-- unset; don&#039;t need both if they are the same&lt;br /&gt;
		end&lt;br /&gt;
	elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then	-- when only |place= (|location=) is set ...&lt;br /&gt;
		PublicationPlace = Place;												-- promote |place= (|location=) to |publication-place&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if PublicationPlace == Place then Place = &#039;&#039;; end							-- don&#039;t need both if they are the same&lt;br /&gt;
&lt;br /&gt;
	local URL_origin = A:ORIGIN(&#039;URL&#039;);											-- get name of parameter that holds URL&lt;br /&gt;
	local ChapterURL_origin = A:ORIGIN(&#039;ChapterURL&#039;);							-- get name of parameter that holds ChapterURL&lt;br /&gt;
	local ScriptChapter = A[&#039;ScriptChapter&#039;];&lt;br /&gt;
	local ScriptChapter_origin = A:ORIGIN (&#039;ScriptChapter&#039;);&lt;br /&gt;
	local Format = A[&#039;Format&#039;];&lt;br /&gt;
	local ChapterFormat = A[&#039;ChapterFormat&#039;];&lt;br /&gt;
	local TransChapter = A[&#039;TransChapter&#039;];&lt;br /&gt;
	local TransChapter_origin = A:ORIGIN (&#039;TransChapter&#039;);&lt;br /&gt;
	local TransTitle = A[&#039;TransTitle&#039;];&lt;br /&gt;
	local ScriptTitle = A[&#039;ScriptTitle&#039;];&lt;br /&gt;
	&lt;br /&gt;
	--[[&lt;br /&gt;
	Parameter remapping for cite encyclopedia:&lt;br /&gt;
	When the citation has these parameters:&lt;br /&gt;
		|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title= for rendering&lt;br /&gt;
		|encyclopedia= and |article= then map |encyclopedia= to |title= for rendering&lt;br /&gt;
&lt;br /&gt;
		|trans-title= maps to |trans-chapter= when |title= is re-mapped&lt;br /&gt;
		|url= maps to |chapter-url= when |title= is remapped&lt;br /&gt;
	&lt;br /&gt;
	All other combinations of |encyclopedia=, |title=, and |article= are not modified&lt;br /&gt;
	&lt;br /&gt;
	]]&lt;br /&gt;
&lt;br /&gt;
	local Encyclopedia = A[&#039;Encyclopedia&#039;];										-- used as a flag by this module and by ~/COinS&lt;br /&gt;
	local ScriptEncyclopedia = A[&#039;ScriptEncyclopedia&#039;];&lt;br /&gt;
	local TransEncyclopedia = A[&#039;TransEncyclopedia&#039;];&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then	-- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}&lt;br /&gt;
		if &#039;encyclopaedia&#039; ~= config.CitationClass and &#039;citation&#039; ~= config.CitationClass then&lt;br /&gt;
			if utilities.is_set (Encyclopedia) then&lt;br /&gt;
				utilities.set_message (&#039;err_parameter_ignored&#039;, {A:ORIGIN (&#039;Encyclopedia&#039;)});&lt;br /&gt;
			else&lt;br /&gt;
				utilities.set_message (&#039;err_parameter_ignored&#039;, {A:ORIGIN (&#039;ScriptEncyclopedia&#039;)});&lt;br /&gt;
			end&lt;br /&gt;
			Encyclopedia = nil;													-- unset these because not supported by this template&lt;br /&gt;
			ScriptEncyclopedia = nil;&lt;br /&gt;
			TransEncyclopedia = nil;&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (TransEncyclopedia) then&lt;br /&gt;
		utilities.set_message (&#039;err_trans_missing_title&#039;, {&#039;encyclopedia&#039;});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (&#039;encyclopaedia&#039; == config.CitationClass) or (&#039;citation&#039; == config.CitationClass and utilities.is_set (Encyclopedia)) then&lt;br /&gt;
		if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then	-- when both parameters set emit an error message; {{citation}} only; Periodical not allowed in {{cite encyclopedia}}&lt;br /&gt;
			utilities.set_message (&#039;err_periodical_ignored&#039;, {Periodical_origin});&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then&lt;br /&gt;
			Periodical = Encyclopedia;											-- error or no, set Periodical to Encyclopedia for rendering; {{citation}} could (not legitimately) have both; use Encyclopedia&lt;br /&gt;
			Periodical_origin = A:ORIGIN (&#039;Encyclopedia&#039;);&lt;br /&gt;
			ScriptPeriodical = ScriptEncyclopedia;&lt;br /&gt;
			ScriptPeriodical_origin = A:ORIGIN (&#039;ScriptEncyclopedia&#039;);&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then&lt;br /&gt;
				if not utilities.is_set (Chapter) then&lt;br /&gt;
					Chapter = Title;											-- |encyclopedia= and |title= are set so map |title= params to |article= params for rendering&lt;br /&gt;
					ScriptChapter = ScriptTitle;&lt;br /&gt;
					ScriptChapter_origin = A:ORIGIN(&#039;ScriptTitle&#039;)&lt;br /&gt;
					TransChapter = TransTitle;&lt;br /&gt;
					ChapterURL = URL;&lt;br /&gt;
					ChapterURL_origin = URL_origin;&lt;br /&gt;
					ChapterUrlAccess = UrlAccess;&lt;br /&gt;
					ChapterFormat = Format;&lt;br /&gt;
&lt;br /&gt;
					if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then&lt;br /&gt;
						Chapter = utilities.make_wikilink (TitleLink, Chapter);&lt;br /&gt;
					end&lt;br /&gt;
					Title = Periodical;											-- now map |encyclopedia= params to |title= params for rendering&lt;br /&gt;
					ScriptTitle = ScriptPeriodical or &#039;&#039;;&lt;br /&gt;
					TransTitle = TransEncyclopedia or &#039;&#039;;&lt;br /&gt;
					Periodical = &#039;&#039;;											-- redundant so unset&lt;br /&gt;
					ScriptPeriodical = &#039;&#039;;&lt;br /&gt;
					URL = &#039;&#039;;&lt;br /&gt;
					Format = &#039;&#039;;&lt;br /&gt;
					TitleLink = &#039;&#039;;&lt;br /&gt;
				end&lt;br /&gt;
			elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then	-- |title= not set&lt;br /&gt;
				Title = Periodical;												-- |encyclopedia= set and |article= set so map |encyclopedia= to |title= for rendering&lt;br /&gt;
				ScriptTitle = ScriptPeriodical or &#039;&#039;;&lt;br /&gt;
				TransTitle = TransEncyclopedia or &#039;&#039;;&lt;br /&gt;
				Periodical = &#039;&#039;;												-- redundant so unset&lt;br /&gt;
				ScriptPeriodical = &#039;&#039;;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- special case for cite techreport.&lt;br /&gt;
	local ID = A[&#039;ID&#039;];&lt;br /&gt;
	if (config.CitationClass == &amp;quot;techreport&amp;quot;) then								-- special case for cite techreport&lt;br /&gt;
		if utilities.is_set (A[&#039;Number&#039;]) then									-- cite techreport uses &#039;number&#039;, which other citations alias to &#039;issue&#039;&lt;br /&gt;
			if not utilities.is_set (ID) then									-- can we use ID for the &amp;quot;number&amp;quot;?&lt;br /&gt;
				ID = A[&#039;Number&#039;];												-- yes, use it&lt;br /&gt;
			else																-- ID has a value so emit error message&lt;br /&gt;
				utilities.set_message (&#039;err_redundant_parameters&#039;, {utilities.wrap_style (&#039;parameter&#039;, &#039;id&#039;) .. cfg.presentation[&#039;sep_list_pair&#039;] .. utilities.wrap_style (&#039;parameter&#039;, &#039;number&#039;)});&lt;br /&gt;
			end&lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Account for the oddity that is {{cite conference}}, before generation of COinS data.&lt;br /&gt;
	local ChapterLink -- = A[&#039;ChapterLink&#039;];									-- deprecated as a parameter but still used internally by cite episode&lt;br /&gt;
	local Conference = A[&#039;Conference&#039;];&lt;br /&gt;
	local BookTitle = A[&#039;BookTitle&#039;];&lt;br /&gt;
	local TransTitle_origin = A:ORIGIN (&#039;TransTitle&#039;);&lt;br /&gt;
	if &#039;conference&#039; == config.CitationClass then&lt;br /&gt;
		if utilities.is_set (BookTitle) then&lt;br /&gt;
			Chapter = Title;&lt;br /&gt;
			Chapter_origin = &#039;title&#039;;&lt;br /&gt;
	--		ChapterLink = TitleLink;											-- |chapter-link= is deprecated&lt;br /&gt;
			ChapterURL = URL;&lt;br /&gt;
			ChapterUrlAccess = UrlAccess;&lt;br /&gt;
			ChapterURL_origin = URL_origin;&lt;br /&gt;
			URL_origin = &#039;&#039;;&lt;br /&gt;
			ChapterFormat = Format;&lt;br /&gt;
			TransChapter = TransTitle;&lt;br /&gt;
			TransChapter_origin = TransTitle_origin;&lt;br /&gt;
			Title = BookTitle;&lt;br /&gt;
			Format = &#039;&#039;;&lt;br /&gt;
	--		TitleLink = &#039;&#039;;&lt;br /&gt;
			TransTitle = &#039;&#039;;&lt;br /&gt;
			URL = &#039;&#039;;&lt;br /&gt;
		end&lt;br /&gt;
	elseif &#039;speech&#039; ~= config.CitationClass then&lt;br /&gt;
		Conference = &#039;&#039;;														-- not cite conference or cite speech so make sure this is empty string&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local use_lowercase = ( sepc == &#039;,&#039; );										-- controls capitalization of certain static text&lt;br /&gt;
	&lt;br /&gt;
	-- cite map oddities&lt;br /&gt;
	local Cartography = &amp;quot;&amp;quot;;&lt;br /&gt;
	local Scale = &amp;quot;&amp;quot;;&lt;br /&gt;
	local Sheet = A[&#039;Sheet&#039;] or &#039;&#039;;&lt;br /&gt;
	local Sheets = A[&#039;Sheets&#039;] or &#039;&#039;;&lt;br /&gt;
	if config.CitationClass == &amp;quot;map&amp;quot; then&lt;br /&gt;
		if utilities.is_set (Chapter) then										--TODO: make a function for this and similar?&lt;br /&gt;
			utilities.set_message (&#039;err_redundant_parameters&#039;, {utilities.wrap_style (&#039;parameter&#039;, &#039;map&#039;) .. cfg.presentation[&#039;sep_list_pair&#039;] .. utilities.wrap_style (&#039;parameter&#039;, Chapter_origin)});	-- add error message&lt;br /&gt;
		end&lt;br /&gt;
		Chapter = A[&#039;Map&#039;];&lt;br /&gt;
		Chapter_origin = A:ORIGIN(&#039;Map&#039;);&lt;br /&gt;
		ChapterURL = A[&#039;MapURL&#039;];&lt;br /&gt;
		ChapterURL_origin = A:ORIGIN(&#039;MapURL&#039;);&lt;br /&gt;
		TransChapter = A[&#039;TransMap&#039;];&lt;br /&gt;
		ScriptChapter = A[&#039;ScriptMap&#039;]&lt;br /&gt;
		ScriptChapter_origin = A:ORIGIN(&#039;ScriptMap&#039;)&lt;br /&gt;
&lt;br /&gt;
		ChapterUrlAccess = MapUrlAccess;&lt;br /&gt;
		ChapterFormat = A[&#039;MapFormat&#039;];&lt;br /&gt;
&lt;br /&gt;
		Cartography = A[&#039;Cartography&#039;];&lt;br /&gt;
		if utilities.is_set ( Cartography ) then&lt;br /&gt;
			Cartography = sepc .. &amp;quot; &amp;quot; .. wrap_msg (&#039;cartography&#039;, Cartography, use_lowercase);&lt;br /&gt;
		end		&lt;br /&gt;
		Scale = A[&#039;Scale&#039;];&lt;br /&gt;
		if utilities.is_set ( Scale ) then&lt;br /&gt;
			Scale = sepc .. &amp;quot; &amp;quot; .. Scale;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.&lt;br /&gt;
	local Series = A[&#039;Series&#039;];&lt;br /&gt;
	if &#039;episode&#039; == config.CitationClass or &#039;serial&#039; == config.CitationClass then&lt;br /&gt;
		local SeriesLink = A[&#039;SeriesLink&#039;];&lt;br /&gt;
&lt;br /&gt;
		SeriesLink = link_title_ok (SeriesLink, A:ORIGIN (&#039;SeriesLink&#039;), Series, &#039;series&#039;);	-- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set&lt;br /&gt;
&lt;br /&gt;
		local Network = A[&#039;Network&#039;];&lt;br /&gt;
		local Station = A[&#039;Station&#039;];&lt;br /&gt;
		local s, n = {}, {};&lt;br /&gt;
																				-- do common parameters first&lt;br /&gt;
		if utilities.is_set (Network) then table.insert(n, Network); end&lt;br /&gt;
		if utilities.is_set (Station) then table.insert(n, Station); end&lt;br /&gt;
		ID = table.concat(n, sepc .. &#039; &#039;);&lt;br /&gt;
		&lt;br /&gt;
		if &#039;episode&#039; == config.CitationClass then								-- handle the oddities that are strictly {{cite episode}}&lt;br /&gt;
			local Season = A[&#039;Season&#039;];&lt;br /&gt;
			local SeriesNumber = A[&#039;SeriesNumber&#039;];&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then	-- these are mutually exclusive so if both are set TODO: make a function for this and similar?&lt;br /&gt;
				utilities.set_message (&#039;err_redundant_parameters&#039;, {utilities.wrap_style (&#039;parameter&#039;, &#039;season&#039;) .. cfg.presentation[&#039;sep_list_pair&#039;] .. utilities.wrap_style (&#039;parameter&#039;, &#039;seriesno&#039;)});		-- add error message&lt;br /&gt;
				SeriesNumber = &#039;&#039;;												-- unset; prefer |season= over |seriesno=&lt;br /&gt;
			end&lt;br /&gt;
																				-- assemble a table of parts concatenated later into Series&lt;br /&gt;
			if utilities.is_set (Season) then table.insert(s, wrap_msg (&#039;season&#039;, Season, use_lowercase)); end&lt;br /&gt;
			if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg (&#039;seriesnum&#039;, SeriesNumber, use_lowercase)); end&lt;br /&gt;
			if utilities.is_set (Issue) then table.insert(s, wrap_msg (&#039;episode&#039;, Issue, use_lowercase)); end&lt;br /&gt;
			Issue = &#039;&#039;;															-- unset because this is not a unique parameter&lt;br /&gt;
	&lt;br /&gt;
			Chapter = Title;													-- promote title parameters to chapter&lt;br /&gt;
			ScriptChapter = ScriptTitle;&lt;br /&gt;
			ScriptChapter_origin = A:ORIGIN(&#039;ScriptTitle&#039;);&lt;br /&gt;
			ChapterLink = TitleLink;											-- alias |episode-link=&lt;br /&gt;
			TransChapter = TransTitle;&lt;br /&gt;
			ChapterURL = URL;&lt;br /&gt;
			ChapterUrlAccess = UrlAccess;&lt;br /&gt;
			ChapterURL_origin = URL_origin;&lt;br /&gt;
			ChapterFormat = Format;&lt;br /&gt;
&lt;br /&gt;
			Title = Series;														-- promote series to title&lt;br /&gt;
			TitleLink = SeriesLink;&lt;br /&gt;
			Series = table.concat(s, sepc .. &#039; &#039;);								-- this is concatenation of season, seriesno, episode number&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then	-- link but not URL&lt;br /&gt;
				Chapter = utilities.make_wikilink (ChapterLink, Chapter);&lt;br /&gt;
			elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then	-- if both are set, URL links episode;&lt;br /&gt;
				Series = utilities.make_wikilink (ChapterLink, Series);&lt;br /&gt;
			end&lt;br /&gt;
			URL = &#039;&#039;;															-- unset&lt;br /&gt;
			TransTitle = &#039;&#039;;&lt;br /&gt;
			ScriptTitle = &#039;&#039;;&lt;br /&gt;
			Format = &#039;&#039;;&lt;br /&gt;
			&lt;br /&gt;
		else																	-- now oddities that are cite serial&lt;br /&gt;
			Issue = &#039;&#039;;															-- unset because this parameter no longer supported by the citation/core version of cite serial&lt;br /&gt;
			Chapter = A[&#039;Episode&#039;];												-- TODO: make |episode= available to cite episode someday?&lt;br /&gt;
			if utilities.is_set (Series) and utilities.is_set (SeriesLink) then&lt;br /&gt;
				Series = utilities.make_wikilink (SeriesLink, Series);&lt;br /&gt;
			end&lt;br /&gt;
			Series = utilities.wrap_style (&#039;italic-title&#039;, Series);				-- series is italicized&lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
	-- end of {{cite episode}} stuff&lt;br /&gt;
&lt;br /&gt;
	-- handle type parameter for those CS1 citations that have default values&lt;br /&gt;
	local TitleType = A[&#039;TitleType&#039;];&lt;br /&gt;
	local Degree = A[&#039;Degree&#039;];&lt;br /&gt;
	if utilities.in_array (config.CitationClass, {&#039;AV-media-notes&#039;, &#039;document&#039;, &#039;interview&#039;, &#039;mailinglist&#039;, &#039;map&#039;, &#039;podcast&#039;, &#039;pressrelease&#039;, &#039;report&#039;, &#039;speech&#039;, &#039;techreport&#039;, &#039;thesis&#039;}) then&lt;br /&gt;
		TitleType = set_titletype (config.CitationClass, TitleType);&lt;br /&gt;
		if utilities.is_set (Degree) and &amp;quot;Thesis&amp;quot; == TitleType then				-- special case for cite thesis&lt;br /&gt;
			TitleType = Degree .. &#039; &#039; .. cfg.title_types [&#039;thesis&#039;]:lower();&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (TitleType) then										-- if type parameter is specified&lt;br /&gt;
		TitleType = utilities.substitute ( cfg.messages[&#039;type&#039;], TitleType);	-- display it in parentheses&lt;br /&gt;
	-- TODO: Hack on TitleType to fix bunched parentheses problem&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- legacy: promote PublicationDate to Date if neither Date nor Year are set.&lt;br /&gt;
	local Date = A[&#039;Date&#039;];&lt;br /&gt;
 	local Date_origin;															-- to hold the name of parameter promoted to Date; required for date error messaging&lt;br /&gt;
	local PublicationDate = A[&#039;PublicationDate&#039;];&lt;br /&gt;
	local Year = A[&#039;Year&#039;];&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (Year) then&lt;br /&gt;
		validation.year_check (Year);											-- returns nothing; emits maint message when |year= doesn&#039;t hold a &#039;year&#039; value&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	if not utilities.is_set (Date) then&lt;br /&gt;
		Date = Year;															-- promote Year to Date&lt;br /&gt;
		Year = nil;																-- make nil so Year as empty string isn&#039;t used for CITEREF&lt;br /&gt;
		if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then	-- use PublicationDate when |date= and |year= are not set&lt;br /&gt;
			Date = PublicationDate;												-- promote PublicationDate to Date&lt;br /&gt;
			PublicationDate = &#039;&#039;;												-- unset, no longer needed&lt;br /&gt;
			Date_origin = A:ORIGIN(&#039;PublicationDate&#039;);							-- save the name of the promoted parameter&lt;br /&gt;
		else&lt;br /&gt;
			Date_origin = A:ORIGIN(&#039;Year&#039;);										-- save the name of the promoted parameter&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		Date_origin = A:ORIGIN(&#039;Date&#039;);											-- not a promotion; name required for error messaging&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if PublicationDate == Date then PublicationDate = &#039;&#039;; end					-- if PublicationDate is same as Date, don&#039;t display in rendered citation&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where&lt;br /&gt;
	we get the date used in the metadata.&lt;br /&gt;
	&lt;br /&gt;
	Date validation supporting code is in Module:Citation/CS1/Date_validation&lt;br /&gt;
	]]&lt;br /&gt;
&lt;br /&gt;
	local DF = is_valid_parameter_value (A[&#039;DF&#039;], A:ORIGIN(&#039;DF&#039;), cfg.keywords_lists[&#039;df&#039;], &#039;&#039;);&lt;br /&gt;
	if not utilities.is_set (DF) then&lt;br /&gt;
		DF = cfg.global_df;														-- local |df= if present overrides global df set by {{use xxx date}} template&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ArchiveURL;&lt;br /&gt;
	local ArchiveDate;&lt;br /&gt;
	local ArchiveFormat = A[&#039;ArchiveFormat&#039;];&lt;br /&gt;
	local archive_url_timestamp;												-- timestamp from wayback machine url&lt;br /&gt;
	&lt;br /&gt;
	ArchiveURL, ArchiveDate, archive_url_timestamp = archive_url_check (A[&#039;ArchiveURL&#039;], A[&#039;ArchiveDate&#039;])&lt;br /&gt;
	ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, &#039;archive-format&#039;, &#039;archive-url&#039;);&lt;br /&gt;
	&lt;br /&gt;
	ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN(&#039;ArchiveURL&#039;), ArchiveDate);		-- add error message when URL or ChapterURL == ArchiveURL&lt;br /&gt;
&lt;br /&gt;
	local AccessDate = A[&#039;AccessDate&#039;];&lt;br /&gt;
	local COinS_date = {};														-- holds date info extracted from |date= for the COinS metadata by Module:Date verification&lt;br /&gt;
	local DoiBroken = A[&#039;DoiBroken&#039;];&lt;br /&gt;
	local Embargo = A[&#039;Embargo&#039;];&lt;br /&gt;
	local anchor_year;															-- used in the CITEREF identifier&lt;br /&gt;
	do	-- create defined block to contain local variables error_message, date_parameters_list, mismatch&lt;br /&gt;
		local error_message = &#039;&#039;;&lt;br /&gt;
																				-- AirDate has been promoted to Date so not necessary to check it&lt;br /&gt;
		local date_parameters_list = {&lt;br /&gt;
			[&#039;access-date&#039;] = {val = AccessDate, name = A:ORIGIN (&#039;AccessDate&#039;)},&lt;br /&gt;
			[&#039;archive-date&#039;] = {val = ArchiveDate, name = A:ORIGIN (&#039;ArchiveDate&#039;)},&lt;br /&gt;
			[&#039;date&#039;] = {val = Date, name = Date_origin},&lt;br /&gt;
			[&#039;doi-broken-date&#039;] = {val = DoiBroken, name = A:ORIGIN (&#039;DoiBroken&#039;)},&lt;br /&gt;
			[&#039;pmc-embargo-date&#039;] = {val = Embargo, name = A:ORIGIN (&#039;Embargo&#039;)},&lt;br /&gt;
			[&#039;publication-date&#039;] = {val = PublicationDate, name = A:ORIGIN (&#039;PublicationDate&#039;)},&lt;br /&gt;
			[&#039;year&#039;] = {val = Year, name = A:ORIGIN (&#039;Year&#039;)},&lt;br /&gt;
			};&lt;br /&gt;
&lt;br /&gt;
		local error_list = {};&lt;br /&gt;
		anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (Year) and utilities.is_set (Date) then				-- both |date= and |year= not normally needed; &lt;br /&gt;
			validation.year_date_check (Year, A:ORIGIN (&#039;Year&#039;), Date, A:ORIGIN (&#039;Date&#039;), error_list);&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if 0 == #error_list then												-- error free dates only; 0 when error_list is empty&lt;br /&gt;
			local modified = false;												-- flag&lt;br /&gt;
			&lt;br /&gt;
			if utilities.is_set (DF) then										-- if we need to reformat dates&lt;br /&gt;
				modified = validation.reformat_dates (date_parameters_list, DF);	-- reformat to DF format, use long month names if appropriate&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if true == validation.date_hyphen_to_dash (date_parameters_list) then	-- convert hyphens to dashes where appropriate&lt;br /&gt;
				modified = true;&lt;br /&gt;
				utilities.set_message (&#039;maint_date_format&#039;);					-- hyphens were converted so add maint category&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
	-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki&lt;br /&gt;
			if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then&lt;br /&gt;
				utilities.set_message (&#039;maint_date_auto_xlated&#039;);				-- add maint cat&lt;br /&gt;
				modified = true;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if modified then													-- if the date_parameters_list values were modified&lt;br /&gt;
				AccessDate = date_parameters_list[&#039;access-date&#039;].val;			-- overwrite date holding parameters with modified values&lt;br /&gt;
				ArchiveDate = date_parameters_list[&#039;archive-date&#039;].val;&lt;br /&gt;
				Date = date_parameters_list[&#039;date&#039;].val;&lt;br /&gt;
				DoiBroken = date_parameters_list[&#039;doi-broken-date&#039;].val;&lt;br /&gt;
				PublicationDate = date_parameters_list[&#039;publication-date&#039;].val;&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if archive_url_timestamp and utilities.is_set (ArchiveDate) then&lt;br /&gt;
				validation.archive_date_check (ArchiveDate, archive_url_timestamp, DF);	-- does YYYYMMDD in archive_url_timestamp match date in ArchiveDate&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			utilities.set_message (&#039;err_bad_date&#039;, {utilities.make_sep_list (#error_list, error_list)});	-- add this error message&lt;br /&gt;
		end&lt;br /&gt;
	end	-- end of do&lt;br /&gt;
&lt;br /&gt;
	if utilities.in_array (config.CitationClass, {&#039;book&#039;, &#039;encyclopaedia&#039;}) or	-- {{cite book}}, {{cite encyclopedia}}; TODO: {{cite conference}} and others?&lt;br /&gt;
		(&#039;citation&#039; == config.CitationClass and utilities.is_set (Encyclopedia)) or			-- {{citation}} as an encylopedia citation&lt;br /&gt;
		(&#039;citation&#039; == config.CitationClass and not utilities.is_set (Periodical)) then		-- {{citation}} as a book citation&lt;br /&gt;
			if utilities.is_set (PublicationPlace) then&lt;br /&gt;
				if not utilities.is_set (PublisherName) then&lt;br /&gt;
					local date = COinS_date.rftdate and tonumber (COinS_date.rftdate:match (&#039;%d%d%d%d&#039;));	-- get year portion of COinS date (because in Arabic numerals); convert string to number&lt;br /&gt;
					if date and (1850 &amp;lt;= date) then								-- location has no publisher; if date is 1850 or later&lt;br /&gt;
						utilities.set_message (&#039;maint_location_no_publisher&#039;);	-- add maint cat&lt;br /&gt;
					end&lt;br /&gt;
				else															-- PublisherName has a value&lt;br /&gt;
					if cfg.keywords_xlate[&#039;none&#039;] == PublisherName then			-- if that value is &#039;none&#039; (only for book and encyclopedia citations)&lt;br /&gt;
						PublisherName = &#039;&#039;;										-- unset&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ID_list = {};															-- sequence table of rendered identifiers&lt;br /&gt;
	local ID_list_coins = {};													-- table of identifiers and their values from args; key is same as cfg.id_handlers&#039;s key&lt;br /&gt;
	local Class = A[&#039;Class&#039;];													-- arxiv class identifier&lt;br /&gt;
	&lt;br /&gt;
	local ID_support = {&lt;br /&gt;
		{A[&#039;ASINTLD&#039;], &#039;ASIN&#039;, &#039;err_asintld_missing_asin&#039;, A:ORIGIN (&#039;ASINTLD&#039;)},				&lt;br /&gt;
		{DoiBroken, &#039;DOI&#039;, &#039;err_doibroken_missing_doi&#039;, A:ORIGIN (&#039;DoiBroken&#039;)},&lt;br /&gt;
		{Embargo, &#039;PMC&#039;, &#039;err_embargo_missing_pmc&#039;, A:ORIGIN (&#039;Embargo&#039;)},&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {&lt;br /&gt;
		DoiBroken = DoiBroken,													-- for |doi=&lt;br /&gt;
		ASINTLD = A[&#039;ASINTLD&#039;],													-- for |asin=&lt;br /&gt;
		Embargo = Embargo,														-- for |pmc=&lt;br /&gt;
		Class = Class,															-- for |arxiv=&lt;br /&gt;
		CitationClass = config.CitationClass,									-- for |arxiv=&lt;br /&gt;
		Year=anchor_year,														-- for |isbn=&lt;br /&gt;
		}, ID_support);&lt;br /&gt;
&lt;br /&gt;
	-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data.&lt;br /&gt;
	if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then	-- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |medrxiv=, |ssrn= required for their templates&lt;br /&gt;
		if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or 		-- can&#039;t use ID_list_coins k/v table here because invalid parameters omitted&lt;br /&gt;
			args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then			-- which causes unexpected parameter missing error message&lt;br /&gt;
				utilities.set_message (&#039;err_&#039; .. config.CitationClass .. &#039;_missing&#039;);		-- add error message&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		Periodical = ({[&#039;arxiv&#039;] = &#039;arXiv&#039;, [&#039;biorxiv&#039;] = &#039;bioRxiv&#039;, [&#039;citeseerx&#039;] = &#039;CiteSeerX&#039;, [&#039;medrxiv&#039;] = &#039;medRxiv&#039;, [&#039;ssrn&#039;] = &#039;Social Science Research Network&#039;})[config.CitationClass];&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free&lt;br /&gt;
&lt;br /&gt;
	if config.CitationClass == &amp;quot;journal&amp;quot; and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {&#039;off&#039;, &#039;none&#039;}) then -- TODO: remove &#039;none&#039; once existing citations have been switched to &#039;off&#039;, so &#039;none&#039; can be used as token for &amp;quot;no title&amp;quot; instead&lt;br /&gt;
		if &#039;none&#039; ~= cfg.keywords_xlate[auto_select] then						-- if auto-linking not disabled&lt;br /&gt;
 	 		if identifiers.auto_link_urls[auto_select] then						-- manual selection&lt;br /&gt;
		 		URL = identifiers.auto_link_urls[auto_select];					-- set URL to be the same as identifier&#039;s external link&lt;br /&gt;
 				URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1];	-- set URL_origin to parameter name for use in error message if citation is missing a |title=&lt;br /&gt;
			elseif identifiers.auto_link_urls[&#039;pmc&#039;] then						-- auto-select PMC&lt;br /&gt;
				URL = identifiers.auto_link_urls[&#039;pmc&#039;];						-- set URL to be the same as the PMC external link if not embargoed&lt;br /&gt;
				URL_origin = cfg.id_handlers[&#039;PMC&#039;].parameters[1];				-- set URL_origin to parameter name for use in error message if citation is missing a |title=&lt;br /&gt;
			elseif identifiers.auto_link_urls[&#039;doi&#039;] then						-- auto-select DOI&lt;br /&gt;
				URL = identifiers.auto_link_urls[&#039;doi&#039;];&lt;br /&gt;
				URL_origin = cfg.id_handlers[&#039;DOI&#039;].parameters[1];&lt;br /&gt;
			end&lt;br /&gt;
 	 	end&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (URL) then											-- set when using an identifier-created URL&lt;br /&gt;
			if utilities.is_set (AccessDate) then								-- |access-date= requires |url=; identifier-created URL is not |url=&lt;br /&gt;
				utilities.set_message (&#039;err_accessdate_missing_url&#039;);			-- add an error message&lt;br /&gt;
				AccessDate = &#039;&#039;;												-- unset&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (ArchiveURL) then								-- |archive-url= requires |url=; identifier-created URL is not |url=&lt;br /&gt;
				utilities.set_message (&#039;err_archive_missing_url&#039;);				-- add an error message&lt;br /&gt;
				ArchiveURL = &#039;&#039;;												-- unset&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- At this point fields may be nil if they weren&#039;t specified in the template use.  We can use that fact.&lt;br /&gt;
	-- Test if citation has no title&lt;br /&gt;
	if	not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then	-- has special case for cite episode&lt;br /&gt;
		utilities.set_message (&#039;err_citation_missing_title&#039;, {&#039;episode&#039; == config.CitationClass and &#039;series&#039; or &#039;title&#039;});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.in_array (cfg.keywords_xlate[Title], {&#039;off&#039;, &#039;none&#039;}) and&lt;br /&gt;
			utilities.in_array (config.CitationClass, {&#039;journal&#039;, &#039;citation&#039;}) and&lt;br /&gt;
			(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and&lt;br /&gt;
			(&#039;journal&#039; == Periodical_origin or &#039;script-journal&#039; == ScriptPeriodical_origin) then	-- special case for journal cites&lt;br /&gt;
				Title = &#039;&#039;;														-- set title to empty string&lt;br /&gt;
				utilities.set_message (&#039;maint_untitled&#039;);						-- add maint cat&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if &#039;journal&#039; == config.CitationClass or (&#039;citation&#039; == config.CitationClass and utilities.is_set (Periodical) and &#039;journal&#039; == Periodical_origin) then&lt;br /&gt;
		if is_page_art_num (((utilities.is_set (Page) and Page) or (utilities.is_set (Pages) and Pages)) or nil, ID_list_coins[&#039;DOI&#039;]) then			-- does |page(s)= look like it holds an article number&lt;br /&gt;
			utilities.set_message (&#039;maint_page_art_num&#039;);						-- add maint cat&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- COinS metadata (see &amp;lt;http://ocoins.info/&amp;gt;) for automated parsing of citation information.&lt;br /&gt;
	-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that&lt;br /&gt;
	-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title&lt;br /&gt;
	-- is the article title, and Chapter is a section within the article.  So, we remap &lt;br /&gt;
	&lt;br /&gt;
	local coins_chapter = Chapter;												-- default assuming that remapping not required&lt;br /&gt;
	local coins_title = Title;													-- et tu&lt;br /&gt;
	if &#039;encyclopaedia&#039; == config.CitationClass or (&#039;citation&#039; == config.CitationClass and utilities.is_set (Encyclopedia)) then&lt;br /&gt;
		if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then		-- if all are used then&lt;br /&gt;
			coins_chapter = Title;												-- remap&lt;br /&gt;
			coins_title = Periodical;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local coins_author = a;														-- default for coins rft.au &lt;br /&gt;
	if 0 &amp;lt; #c then																-- but if contributor list&lt;br /&gt;
		coins_author = c;														-- use that instead&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- this is the function call to COinS()&lt;br /&gt;
	local OCinSoutput = metadata.COinS({&lt;br /&gt;
		[&#039;Periodical&#039;] = utilities.strip_apostrophe_markup (Periodical),		-- no markup in the metadata&lt;br /&gt;
		[&#039;Encyclopedia&#039;] = Encyclopedia,										-- just a flag; content ignored by ~/COinS&lt;br /&gt;
		[&#039;Chapter&#039;] = metadata.make_coins_title (coins_chapter, ScriptChapter),	-- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup&lt;br /&gt;
		[&#039;Degree&#039;] = Degree;													-- cite thesis only&lt;br /&gt;
		[&#039;Title&#039;] = metadata.make_coins_title (coins_title, ScriptTitle),		-- Title and ScriptTitle stripped of bold / italic / accept-as-written markup&lt;br /&gt;
		[&#039;PublicationPlace&#039;] = PublicationPlace,&lt;br /&gt;
		[&#039;Date&#039;] = COinS_date.rftdate,											-- COinS_date.* has correctly formatted date values if Date is valid;&lt;br /&gt;
		[&#039;Season&#039;] = COinS_date.rftssn,&lt;br /&gt;
		[&#039;Quarter&#039;] = COinS_date.rftquarter,&lt;br /&gt;
		[&#039;Chron&#039;] =  COinS_date.rftchron,&lt;br /&gt;
		[&#039;Series&#039;] = Series,&lt;br /&gt;
		[&#039;Volume&#039;] = Volume,&lt;br /&gt;
		[&#039;Issue&#039;] = Issue,&lt;br /&gt;
		[&#039;ArticleNumber&#039;] = ArticleNumber,&lt;br /&gt;
		[&#039;Pages&#039;] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)),	-- pages stripped of external links&lt;br /&gt;
		[&#039;Edition&#039;] = Edition,&lt;br /&gt;
		[&#039;PublisherName&#039;] = PublisherName or Newsgroup,							-- any apostrophe markup already removed from PublisherName&lt;br /&gt;
		[&#039;URL&#039;] = first_set ({ChapterURL, URL}, 2),&lt;br /&gt;
		[&#039;Authors&#039;] = coins_author,&lt;br /&gt;
		[&#039;ID_list&#039;] = ID_list_coins,&lt;br /&gt;
		[&#039;RawPage&#039;] = this_page.prefixedText,&lt;br /&gt;
	}, config.CitationClass);&lt;br /&gt;
&lt;br /&gt;
	-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, and {{cite ssrn}} AFTER generation of COinS data.&lt;br /&gt;
	if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then	-- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, medRxiv, or ssrn now unset so it isn&#039;t displayed&lt;br /&gt;
		Periodical = &#039;&#039;;														-- periodical not allowed in these templates; if article has been published, use cite journal&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- special case for cite newsgroup.  Do this after COinS because we are modifying Publishername to include some static text&lt;br /&gt;
	if &#039;newsgroup&#039; == config.CitationClass and utilities.is_set (Newsgroup) then&lt;br /&gt;
		PublisherName = utilities.substitute (cfg.messages[&#039;newsgroup&#039;], external_link( &#039;news:&#039; .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Editors;&lt;br /&gt;
	local EditorCount;															-- used only for choosing {ed.) or (eds.) annotation at end of editor name-list&lt;br /&gt;
	local Contributors;															-- assembled contributors name list&lt;br /&gt;
	local contributor_etal;&lt;br /&gt;
	local Translators;															-- assembled translators name list&lt;br /&gt;
	local translator_etal;&lt;br /&gt;
	local t = {};																-- translators list from |translator-lastn= / translator-firstn= pairs&lt;br /&gt;
	t = extract_names (args, &#039;TranslatorList&#039;);									-- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=&lt;br /&gt;
	local Interviewers;															&lt;br /&gt;
	local interviewers_list = {};					&lt;br /&gt;
	interviewers_list = extract_names (args, &#039;InterviewerList&#039;);				-- process preferred interviewers parameters&lt;br /&gt;
	local interviewer_etal;&lt;br /&gt;
	&lt;br /&gt;
	-- Now perform various field substitutions.&lt;br /&gt;
	-- We also add leading spaces and surrounding markup and punctuation to the&lt;br /&gt;
	-- various parts of the citation, but only when they are non-nil.&lt;br /&gt;
	do&lt;br /&gt;
		local last_first_list;&lt;br /&gt;
		local control = { &lt;br /&gt;
			format = NameListStyle,												-- empty string, &#039;&amp;amp;&#039;, &#039;amp&#039;, &#039;and&#039;, or &#039;vanc&#039;&lt;br /&gt;
			maximum = nil,														-- as if display-authors or display-editors not set&lt;br /&gt;
			mode = Mode&lt;br /&gt;
		};&lt;br /&gt;
&lt;br /&gt;
		do																		-- do editor name list first because the now unsupported coauthors used to modify control table&lt;br /&gt;
			local display_names, param = display_names_select (cfg.global_cs1_config_t[&#039;DisplayEditors&#039;], A[&#039;DisplayEditors&#039;], A:ORIGIN (&#039;DisplayEditors&#039;), #e);&lt;br /&gt;
			control.maximum, editor_etal = get_display_names (display_names, #e, &#039;editors&#039;, editor_etal, param);&lt;br /&gt;
&lt;br /&gt;
			Editors, EditorCount = list_people (control, e, editor_etal);&lt;br /&gt;
&lt;br /&gt;
			if 1 == EditorCount and (true == editor_etal or 1 &amp;lt; #e) then		-- only one editor displayed but includes etal then &lt;br /&gt;
				EditorCount = 2;												-- spoof to display (eds.) annotation&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		do																		-- now do interviewers&lt;br /&gt;
			local display_names, param = display_names_select (cfg.global_cs1_config_t[&#039;DisplayInterviewers&#039;], A[&#039;DisplayInterviewers&#039;], A:ORIGIN (&#039;DisplayInterviewers&#039;), #interviewers_list);&lt;br /&gt;
			control.maximum, interviewer_etal = get_display_names (display_names, #interviewers_list, &#039;interviewers&#039;, interviewer_etal, param);&lt;br /&gt;
&lt;br /&gt;
			Interviewers = list_people (control, interviewers_list, interviewer_etal);&lt;br /&gt;
		end&lt;br /&gt;
		do																		-- now do translators&lt;br /&gt;
			local display_names, param = display_names_select (cfg.global_cs1_config_t[&#039;DisplayTranslators&#039;], A[&#039;DisplayTranslators&#039;], A:ORIGIN (&#039;DisplayTranslators&#039;), #t);&lt;br /&gt;
			control.maximum, translator_etal = get_display_names (display_names, #t, &#039;translators&#039;, translator_etal, param);&lt;br /&gt;
&lt;br /&gt;
			Translators = list_people (control, t, translator_etal);&lt;br /&gt;
		end&lt;br /&gt;
		do																		-- now do contributors&lt;br /&gt;
			local display_names, param = display_names_select (cfg.global_cs1_config_t[&#039;DisplayContributors&#039;], A[&#039;DisplayContributors&#039;], A:ORIGIN (&#039;DisplayContributors&#039;), #c);&lt;br /&gt;
			control.maximum, contributor_etal = get_display_names (display_names, #c, &#039;contributors&#039;, contributor_etal, param);&lt;br /&gt;
&lt;br /&gt;
			Contributors = list_people (control, c, contributor_etal);&lt;br /&gt;
		end&lt;br /&gt;
		do																		-- now do authors&lt;br /&gt;
			local display_names, param = display_names_select (cfg.global_cs1_config_t[&#039;DisplayAuthors&#039;], A[&#039;DisplayAuthors&#039;], A:ORIGIN (&#039;DisplayAuthors&#039;), #a, author_etal);&lt;br /&gt;
			control.maximum, author_etal = get_display_names (display_names, #a, &#039;authors&#039;, author_etal, param);&lt;br /&gt;
&lt;br /&gt;
			last_first_list = list_people (control, a, author_etal);&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (Authors) then&lt;br /&gt;
				Authors, author_etal = name_has_etal (Authors, author_etal, false, &#039;authors&#039;);	-- find and remove variations on et al.&lt;br /&gt;
				if author_etal then&lt;br /&gt;
					Authors = Authors .. &#039; &#039; .. cfg.messages[&#039;et al&#039;];			-- add et al. to authors parameter&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				Authors = last_first_list;										-- either an author name list or an empty string&lt;br /&gt;
			end&lt;br /&gt;
		end																		-- end of do&lt;br /&gt;
	&lt;br /&gt;
		if utilities.is_set (Authors) and utilities.is_set (Collaboration) then&lt;br /&gt;
			Authors = Authors .. &#039; (&#039; .. Collaboration .. &#039;)&#039;;					-- add collaboration after et al.&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ConferenceFormat = A[&#039;ConferenceFormat&#039;];&lt;br /&gt;
	local ConferenceURL = A[&#039;ConferenceURL&#039;];&lt;br /&gt;
	ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, &#039;conference-format&#039;, &#039;conference-url&#039;);&lt;br /&gt;
	Format = style_format (Format, URL, &#039;format&#039;, &#039;url&#039;);&lt;br /&gt;
&lt;br /&gt;
	-- special case for chapter format so no error message or cat when chapter not supported&lt;br /&gt;
	if not (utilities.in_array (config.CitationClass, {&#039;web&#039;, &#039;news&#039;, &#039;journal&#039;, &#039;magazine&#039;, &#039;pressrelease&#039;, &#039;podcast&#039;, &#039;newsgroup&#039;, &#039;arxiv&#039;, &#039;biorxiv&#039;, &#039;citeseerx&#039;, &#039;medrxiv&#039;, &#039;ssrn&#039;}) or&lt;br /&gt;
		(&#039;citation&#039; == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then&lt;br /&gt;
			ChapterFormat = style_format (ChapterFormat, ChapterURL, &#039;chapter-format&#039;, &#039;chapter-url&#039;);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not utilities.is_set (URL) then&lt;br /&gt;
		if utilities.in_array (config.CitationClass, {&amp;quot;web&amp;quot;, &amp;quot;podcast&amp;quot;, &amp;quot;mailinglist&amp;quot;}) or		-- |url= required for cite web, cite podcast, and cite mailinglist&lt;br /&gt;
			(&#039;citation&#039; == config.CitationClass and (&#039;website&#039; == Periodical_origin or &#039;script-website&#039; == ScriptPeriodical_origin)) then	-- and required for {{citation}} with |website= or |script-website=&lt;br /&gt;
				utilities.set_message (&#039;err_cite_web_url&#039;);&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- do we have |accessdate= without either |url= or |chapter-url=?&lt;br /&gt;
		if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then		-- ChapterURL may be set when URL is not set;&lt;br /&gt;
			utilities.set_message (&#039;err_accessdate_missing_url&#039;);&lt;br /&gt;
			AccessDate = &#039;&#039;;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local UrlStatus = is_valid_parameter_value (A[&#039;UrlStatus&#039;], A:ORIGIN(&#039;UrlStatus&#039;), cfg.keywords_lists[&#039;url-status&#039;], &#039;&#039;);&lt;br /&gt;
	local OriginalURL&lt;br /&gt;
	local OriginalURL_origin&lt;br /&gt;
	local OriginalFormat&lt;br /&gt;
	local OriginalAccess;&lt;br /&gt;
	UrlStatus = UrlStatus:lower();												-- used later when assembling archived text&lt;br /&gt;
	if utilities.is_set ( ArchiveURL ) then&lt;br /&gt;
		if utilities.is_set (ChapterURL) then 									-- if chapter-url= is set apply archive url to it&lt;br /&gt;
			OriginalURL = ChapterURL;											-- save copy of source chapter&#039;s url for archive text&lt;br /&gt;
			OriginalURL_origin = ChapterURL_origin;								-- name of |chapter-url= parameter for error messages&lt;br /&gt;
			OriginalFormat = ChapterFormat;										-- and original |chapter-format=&lt;br /&gt;
&lt;br /&gt;
			if &#039;live&#039; ~= UrlStatus then&lt;br /&gt;
				ChapterURL = ArchiveURL											-- swap-in the archive&#039;s URL&lt;br /&gt;
				ChapterURL_origin = A:ORIGIN(&#039;ArchiveURL&#039;)						-- name of |archive-url= parameter for error messages&lt;br /&gt;
				ChapterFormat = ArchiveFormat or &#039;&#039;;							-- swap in archive&#039;s format&lt;br /&gt;
				ChapterUrlAccess = nil;											-- restricted access levels do not make sense for archived URLs&lt;br /&gt;
			end&lt;br /&gt;
		elseif utilities.is_set (URL) then&lt;br /&gt;
			OriginalURL = URL;													-- save copy of original source URL&lt;br /&gt;
			OriginalURL_origin = URL_origin;									-- name of URL parameter for error messages&lt;br /&gt;
			OriginalFormat = Format; 											-- and original |format=&lt;br /&gt;
			OriginalAccess = UrlAccess;&lt;br /&gt;
&lt;br /&gt;
			if &#039;live&#039; ~= UrlStatus then											-- if URL set then |archive-url= applies to it&lt;br /&gt;
				URL = ArchiveURL												-- swap-in the archive&#039;s URL&lt;br /&gt;
				URL_origin = A:ORIGIN(&#039;ArchiveURL&#039;)								-- name of archive URL parameter for error messages&lt;br /&gt;
				Format = ArchiveFormat or &#039;&#039;;									-- swap in archive&#039;s format&lt;br /&gt;
				UrlAccess = nil;												-- restricted access levels do not make sense for archived URLs&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (UrlStatus) then									-- if |url-status= is set when |archive-url= is not set&lt;br /&gt;
 		utilities.set_message (&#039;maint_url_status&#039;);								-- add maint cat&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.in_array (config.CitationClass, {&#039;web&#039;, &#039;news&#039;, &#039;journal&#039;, &#039;magazine&#039;, &#039;pressrelease&#039;, &#039;podcast&#039;, &#039;newsgroup&#039;, &#039;arxiv&#039;, &#039;biorxiv&#039;, &#039;citeseerx&#039;, &#039;medrxiv&#039;, &#039;ssrn&#039;}) or	-- if any of the &#039;periodical&#039; cites except encyclopedia&lt;br /&gt;
		(&#039;citation&#039; == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then&lt;br /&gt;
			local chap_param;&lt;br /&gt;
			if utilities.is_set (Chapter) then									-- get a parameter name from one of these chapter related meta-parameters&lt;br /&gt;
				chap_param = A:ORIGIN (&#039;Chapter&#039;)&lt;br /&gt;
			elseif utilities.is_set (TransChapter) then&lt;br /&gt;
				chap_param = A:ORIGIN (&#039;TransChapter&#039;)&lt;br /&gt;
			elseif utilities.is_set (ChapterURL) then&lt;br /&gt;
				chap_param = A:ORIGIN (&#039;ChapterURL&#039;)&lt;br /&gt;
			elseif utilities.is_set (ScriptChapter) then&lt;br /&gt;
				chap_param = ScriptChapter_origin;&lt;br /&gt;
			else utilities.is_set (ChapterFormat)&lt;br /&gt;
				chap_param = A:ORIGIN (&#039;ChapterFormat&#039;)&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if utilities.is_set (chap_param) then								-- if we found one&lt;br /&gt;
				utilities.set_message (&#039;err_chapter_ignored&#039;, {chap_param});	-- add error message&lt;br /&gt;
				Chapter = &#039;&#039;;													-- and set them to empty string to be safe with concatenation&lt;br /&gt;
				TransChapter = &#039;&#039;;&lt;br /&gt;
				ChapterURL = &#039;&#039;;&lt;br /&gt;
				ScriptChapter = &#039;&#039;;&lt;br /&gt;
				ChapterFormat = &#039;&#039;;&lt;br /&gt;
			end&lt;br /&gt;
	else																		-- otherwise, format chapter / article title&lt;br /&gt;
		local no_quotes = false;												-- default assume that we will be quoting the chapter parameter value&lt;br /&gt;
		if utilities.is_set (Contribution) and 0 &amp;lt; #c then						-- if this is a contribution with contributor(s)&lt;br /&gt;
			if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then	-- and a generic contribution title&lt;br /&gt;
				no_quotes = true;												-- then render it unquoted&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess);		-- Contribution is also in Chapter&lt;br /&gt;
		if utilities.is_set (Chapter) then&lt;br /&gt;
			Chapter = Chapter .. ChapterFormat ;&lt;br /&gt;
			if &#039;map&#039; == config.CitationClass and utilities.is_set (TitleType) then&lt;br /&gt;
				Chapter = Chapter .. &#039; &#039; .. TitleType;							-- map annotation here; not after title&lt;br /&gt;
			end&lt;br /&gt;
			Chapter = Chapter .. sepc .. &#039; &#039;;&lt;br /&gt;
		elseif utilities.is_set (ChapterFormat) then							-- |chapter= not set but |chapter-format= is so ...&lt;br /&gt;
			Chapter = ChapterFormat .. sepc .. &#039; &#039;;								-- ... ChapterFormat has error message, we want to see it&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Format main title&lt;br /&gt;
	local plain_title = false;&lt;br /&gt;
	local accept_title;&lt;br /&gt;
	Title, accept_title = utilities.has_accept_as_written (Title, true);		-- remove accept-this-as-written markup when it wraps all of &amp;lt;Title&amp;gt;&lt;br /&gt;
	if accept_title and (&#039;&#039; == Title) then										-- only support forced empty for now &amp;quot;(())&amp;quot;&lt;br /&gt;
		Title = cfg.messages[&#039;notitle&#039;];										-- replace by predefined &amp;quot;No title&amp;quot; message&lt;br /&gt;
			-- TODO: utilities.set_message ( &#039;err_redundant_parameters&#039;, ...);	-- issue proper error message instead of muting	 &lt;br /&gt;
			ScriptTitle = &#039;&#039;;													-- just mute for now	 &lt;br /&gt;
			TransTitle = &#039;&#039;;													-- just mute for now&lt;br /&gt;
 		plain_title = true;														-- suppress text decoration for descriptive title&lt;br /&gt;
		utilities.set_message (&#039;maint_untitled&#039;);								-- add maint cat&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not accept_title then													-- &amp;lt;Title&amp;gt; not wrapped in accept-as-written markup&lt;br /&gt;
		if &#039;...&#039; == Title:sub (-3) then											-- if ellipsis is the last three characters of |title=&lt;br /&gt;
			Title = Title:gsub (&#039;(%.%.%.)%.+$&#039;, &#039;%1&#039;);							-- limit the number of dots to three&lt;br /&gt;
		elseif not mw.ustring.find (Title, &#039;%.%s*%a%.$&#039;) and					-- end of title is not a &#039;dot-(optional space-)letter-dot&#039; initialism ...&lt;br /&gt;
			not mw.ustring.find (Title, &#039;%s+%a%.$&#039;) then						-- ...and not a &#039;space-letter-dot&#039; initial (&#039;&#039;Allium canadense&#039;&#039; L.)&lt;br /&gt;
				Title = mw.ustring.gsub(Title, &#039;%&#039; .. sepc .. &#039;$&#039;, &#039;&#039;);			-- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then&lt;br /&gt;
			utilities.set_message (&#039;maint_archived_copy&#039;);						-- add maintenance category before we modify the content of Title&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if is_generic (&#039;generic_titles&#039;, Title) then&lt;br /&gt;
			utilities.set_message (&#039;err_generic_title&#039;);						-- set an error message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (not plain_title) and (utilities.in_array (config.CitationClass, {&#039;web&#039;, &#039;news&#039;, &#039;journal&#039;, &#039;magazine&#039;, &#039;document&#039;, &#039;pressrelease&#039;, &#039;podcast&#039;, &#039;newsgroup&#039;, &#039;mailinglist&#039;, &#039;interview&#039;, &#039;arxiv&#039;, &#039;biorxiv&#039;, &#039;citeseerx&#039;, &#039;medrxiv&#039;, &#039;ssrn&#039;}) or&lt;br /&gt;
		(&#039;citation&#039; == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or&lt;br /&gt;
		(&#039;map&#039; == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then		-- special case for cite map when the map is in a periodical treat as an article&lt;br /&gt;
			Title = kern_quotes (Title);										-- if necessary, separate title&#039;s leading and trailing quote marks from module provided quote marks&lt;br /&gt;
			Title = utilities.wrap_style (&#039;quoted-title&#039;, Title);&lt;br /&gt;
			Title = script_concatenate (Title, ScriptTitle, &#039;script-title&#039;);	-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; must be done after title is wrapped&lt;br /&gt;
			TransTitle = utilities.wrap_style (&#039;trans-quoted-title&#039;, TransTitle );&lt;br /&gt;
	elseif plain_title or (&#039;report&#039; == config.CitationClass) then				-- no styling for cite report and descriptive titles (otherwise same as above)&lt;br /&gt;
		Title = script_concatenate (Title, ScriptTitle, &#039;script-title&#039;);		-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; must be done after title is wrapped&lt;br /&gt;
		TransTitle = utilities.wrap_style (&#039;trans-quoted-title&#039;, TransTitle );	-- for cite report, use this form for trans-title&lt;br /&gt;
	else&lt;br /&gt;
		Title = utilities.wrap_style (&#039;italic-title&#039;, Title);&lt;br /&gt;
		Title = script_concatenate (Title, ScriptTitle, &#039;script-title&#039;);		-- &amp;lt;bdi&amp;gt; tags, lang attribute, categorization, etc.; must be done after title is wrapped&lt;br /&gt;
		TransTitle = utilities.wrap_style (&#039;trans-italic-title&#039;, TransTitle);&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (TransTitle) then&lt;br /&gt;
		if utilities.is_set (Title) then&lt;br /&gt;
			TransTitle = &amp;quot; &amp;quot; .. TransTitle;&lt;br /&gt;
		else&lt;br /&gt;
			utilities.set_message (&#039;err_trans_missing_title&#039;, {&#039;title&#039;});&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (Title) then											-- TODO: is this the right place to be making Wikisource URLs?&lt;br /&gt;
		if utilities.is_set (TitleLink) and utilities.is_set (URL) then&lt;br /&gt;
			utilities.set_message (&#039;err_wikilink_in_url&#039;);						-- set an error message because we can&#039;t have both&lt;br /&gt;
			TitleLink = &#039;&#039;;														-- unset&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
		if not utilities.is_set (TitleLink) and utilities.is_set (URL) then&lt;br /&gt;
			Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;&lt;br /&gt;
			URL = &#039;&#039;;															-- unset these because no longer needed&lt;br /&gt;
			Format = &amp;quot;&amp;quot;;&lt;br /&gt;
		elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then&lt;br /&gt;
			local ws_url;&lt;br /&gt;
			ws_url = wikisource_url_make (TitleLink);							-- ignore ws_label return; not used here&lt;br /&gt;
			if ws_url then&lt;br /&gt;
				Title = external_link (ws_url, Title .. &#039;&amp;amp;nbsp;&#039;, &#039;ws link in title-link&#039;);	-- space char after Title to move icon away from italic text; TODO: a better way to do this?&lt;br /&gt;
				Title = utilities.substitute (cfg.presentation[&#039;interwiki-icon&#039;], {cfg.presentation[&#039;class-wikisource&#039;], TitleLink, Title});				&lt;br /&gt;
				Title = Title .. TransTitle;&lt;br /&gt;
			else&lt;br /&gt;
				Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			local ws_url, ws_label, L;											-- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)&lt;br /&gt;
			ws_url, ws_label, L = wikisource_url_make (Title:gsub(&#039;^[\&#039;&amp;quot;]*(.-)[\&#039;&amp;quot;]*$&#039;, &#039;%1&#039;));	-- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label&lt;br /&gt;
			if ws_url then&lt;br /&gt;
				Title = Title:gsub (&#039;%b[]&#039;, ws_label);							-- replace interwiki link with ws_label to retain markup&lt;br /&gt;
				Title = external_link (ws_url, Title .. &#039;&amp;amp;nbsp;&#039;, &#039;ws link in title&#039;);	-- space char after Title to move icon away from italic text; TODO: a better way to do this?&lt;br /&gt;
				Title = utilities.substitute (cfg.presentation[&#039;interwiki-icon&#039;], {cfg.presentation[&#039;class-wikisource&#039;], L, Title});				&lt;br /&gt;
				Title = Title .. TransTitle;&lt;br /&gt;
			else&lt;br /&gt;
				Title = Title .. TransTitle;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		Title = TransTitle;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (Place) then&lt;br /&gt;
		Place = &amp;quot; &amp;quot; .. wrap_msg (&#039;written&#039;, Place, use_lowercase) .. sepc .. &amp;quot; &amp;quot;;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ConferenceURL_origin = A:ORIGIN(&#039;ConferenceURL&#039;);						-- get name of parameter that holds ConferenceURL&lt;br /&gt;
	if utilities.is_set (Conference) then&lt;br /&gt;
		if utilities.is_set (ConferenceURL) then&lt;br /&gt;
			Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );&lt;br /&gt;
		end&lt;br /&gt;
		Conference = sepc .. &amp;quot; &amp;quot; .. Conference .. ConferenceFormat;&lt;br /&gt;
	elseif utilities.is_set (ConferenceURL) then&lt;br /&gt;
		Conference = sepc .. &amp;quot; &amp;quot; .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Position = &#039;&#039;;&lt;br /&gt;
	if not utilities.is_set (Position) then&lt;br /&gt;
		local Minutes = A[&#039;Minutes&#039;];&lt;br /&gt;
		local Time = A[&#039;Time&#039;];&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (Minutes) then&lt;br /&gt;
			if utilities.is_set (Time) then		--TODO: make a function for this and similar?&lt;br /&gt;
				utilities.set_message (&#039;err_redundant_parameters&#039;, {utilities.wrap_style (&#039;parameter&#039;, &#039;minutes&#039;) .. cfg.presentation[&#039;sep_list_pair&#039;] .. utilities.wrap_style (&#039;parameter&#039;, &#039;time&#039;)});&lt;br /&gt;
			end&lt;br /&gt;
			Position = &amp;quot; &amp;quot; .. Minutes .. &amp;quot; &amp;quot; .. cfg.messages[&#039;minutes&#039;];&lt;br /&gt;
		else&lt;br /&gt;
			if utilities.is_set (Time) then&lt;br /&gt;
				local TimeCaption = A[&#039;TimeCaption&#039;]&lt;br /&gt;
				if not utilities.is_set (TimeCaption) then&lt;br /&gt;
					TimeCaption = cfg.messages[&#039;event&#039;];&lt;br /&gt;
					if sepc ~= &#039;.&#039; then&lt;br /&gt;
						TimeCaption = TimeCaption:lower();&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				Position = &amp;quot; &amp;quot; .. TimeCaption .. &amp;quot; &amp;quot; .. Time;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		Position = &amp;quot; &amp;quot; .. Position;&lt;br /&gt;
		At = &#039;&#039;;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);&lt;br /&gt;
&lt;br /&gt;
	At = utilities.is_set (At) and (sepc .. &amp;quot; &amp;quot; .. At) or &amp;quot;&amp;quot;;&lt;br /&gt;
	Position = utilities.is_set (Position) and (sepc .. &amp;quot; &amp;quot; .. Position) or &amp;quot;&amp;quot;;&lt;br /&gt;
	if config.CitationClass == &#039;map&#039; then&lt;br /&gt;
		local Sections = A[&#039;Sections&#039;];											-- Section (singular) is an alias of Chapter so set earlier&lt;br /&gt;
		local Inset = A[&#039;Inset&#039;];&lt;br /&gt;
		&lt;br /&gt;
		if utilities.is_set ( Inset ) then&lt;br /&gt;
			Inset = sepc .. &amp;quot; &amp;quot; .. wrap_msg (&#039;inset&#039;, Inset, use_lowercase);&lt;br /&gt;
		end			&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set ( Sections ) then&lt;br /&gt;
			Section = sepc .. &amp;quot; &amp;quot; .. wrap_msg (&#039;sections&#039;, Sections, use_lowercase);&lt;br /&gt;
		elseif utilities.is_set ( Section ) then&lt;br /&gt;
			Section = sepc .. &amp;quot; &amp;quot; .. wrap_msg (&#039;section&#039;, Section, use_lowercase);&lt;br /&gt;
		end&lt;br /&gt;
		At = At .. Inset .. Section;		&lt;br /&gt;
	end	&lt;br /&gt;
&lt;br /&gt;
	local Others = A[&#039;Others&#039;];&lt;br /&gt;
	if utilities.is_set (Others) and 0 == #a and 0 == #e then					-- add maint cat when |others= has value and used without |author=, |editor=&lt;br /&gt;
		if config.CitationClass == &amp;quot;AV-media-notes&amp;quot;&lt;br /&gt;
		or config.CitationClass == &amp;quot;audio-visual&amp;quot; then							-- special maint for AV/M which has a lot of &#039;false&#039; positives right now&lt;br /&gt;
			utilities.set_message (&#039;maint_others_avm&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			utilities.set_message (&#039;maint_others&#039;);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	Others = utilities.is_set (Others) and (sepc .. &amp;quot; &amp;quot; .. Others) or &amp;quot;&amp;quot;;&lt;br /&gt;
	&lt;br /&gt;
	if utilities.is_set (Translators) then&lt;br /&gt;
		Others = safe_join ({sepc .. &#039; &#039;, wrap_msg (&#039;translated&#039;, Translators, use_lowercase), Others}, sepc);&lt;br /&gt;
	end&lt;br /&gt;
	if utilities.is_set (Interviewers) then&lt;br /&gt;
		Others = safe_join ({sepc .. &#039; &#039;, wrap_msg (&#039;interview&#039;, Interviewers, use_lowercase), Others}, sepc);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local TitleNote = A[&#039;TitleNote&#039;];&lt;br /&gt;
	TitleNote = utilities.is_set (TitleNote) and (sepc .. &amp;quot; &amp;quot; .. TitleNote) or &amp;quot;&amp;quot;;&lt;br /&gt;
	if utilities.is_set (Edition) then&lt;br /&gt;
		if Edition:match (&#039;%f[%a][Ee]d%n?%.?$&#039;) or Edition:match (&#039;%f[%a][Ee]dition$&#039;) then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.&lt;br /&gt;
			utilities.set_message (&#039;err_extra_text_edition&#039;);					 -- add error message&lt;br /&gt;
		end&lt;br /&gt;
		Edition = &amp;quot; &amp;quot; .. wrap_msg (&#039;edition&#039;, Edition);&lt;br /&gt;
	else&lt;br /&gt;
		Edition = &#039;&#039;;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	Series = utilities.is_set (Series) and wrap_msg (&#039;series&#039;, {sepc, Series}) or &amp;quot;&amp;quot;;	-- not the same as SeriesNum&lt;br /&gt;
	local Agency = A[&#039;Agency&#039;] or &#039;&#039;;											-- |agency= is supported by {{cite magazine}}, {{cite news}}, {{cite press release}}, {{cite web}}, and certain {{citation}} templates&lt;br /&gt;
	if utilities.is_set (Agency) then											-- this testing done here because {{citation}} supports &#039;news&#039; citations&lt;br /&gt;
		if utilities.in_array (config.CitationClass, {&#039;magazine&#039;, &#039;news&#039;, &#039;pressrelease&#039;, &#039;web&#039;}) or (&#039;citation&#039; == config.CitationClass and utilities.in_array (Periodical_origin, {&amp;quot;magazine&amp;quot;, &amp;quot;newspaper&amp;quot;, &amp;quot;work&amp;quot;})) then&lt;br /&gt;
			Agency = wrap_msg (&#039;agency&#039;, {sepc, Agency});						-- format for rendering&lt;br /&gt;
		else&lt;br /&gt;
			Agency = &#039;&#039;;														-- unset; not supported&lt;br /&gt;
			utilities.set_message (&#039;err_parameter_ignored&#039;, {&#039;agency&#039;});		-- add error message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (AccessDate) then&lt;br /&gt;
		local retrv_text = &amp;quot; &amp;quot; .. cfg.messages[&#039;retrieved&#039;]&lt;br /&gt;
&lt;br /&gt;
		AccessDate = nowrap_date (AccessDate);									-- wrap in nowrap span if date in appropriate format&lt;br /&gt;
		if (sepc ~= &amp;quot;.&amp;quot;) then retrv_text = retrv_text:lower() end				-- if mode is cs2, lower case&lt;br /&gt;
		AccessDate = utilities.substitute (retrv_text, AccessDate);				-- add retrieved text&lt;br /&gt;
&lt;br /&gt;
		AccessDate = utilities.substitute (cfg.presentation[&#039;accessdate&#039;], {sepc, AccessDate});	-- allow editors to hide accessdates&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if utilities.is_set (ID) then ID = sepc .. &amp;quot; &amp;quot; .. ID; end&lt;br /&gt;
	&lt;br /&gt;
	local Docket = A[&#039;Docket&#039;];&lt;br /&gt;
   	if &amp;quot;thesis&amp;quot; == config.CitationClass and utilities.is_set (Docket) then&lt;br /&gt;
		ID = sepc .. &amp;quot; Docket &amp;quot; .. Docket .. ID;&lt;br /&gt;
	end&lt;br /&gt;
   	if &amp;quot;report&amp;quot; == config.CitationClass and utilities.is_set (Docket) then		-- for cite report when |docket= is set&lt;br /&gt;
		ID = sepc .. &#039; &#039; .. Docket;												-- overwrite ID even if |id= is set&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (URL) then&lt;br /&gt;
		URL = &amp;quot; &amp;quot; .. external_link( URL, nil, URL_origin, UrlAccess );&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- We check length of PostScript here because it will have been nuked by&lt;br /&gt;
	-- the quote parameters. We&#039;d otherwise emit a message even if there wasn&#039;t&lt;br /&gt;
	-- a displayed postscript.&lt;br /&gt;
	-- TODO: Should the max size (1) be configurable?&lt;br /&gt;
	-- TODO: Should we check a specific pattern?&lt;br /&gt;
	if utilities.is_set(PostScript) and mw.ustring.len(PostScript) &amp;gt; 1 then&lt;br /&gt;
		utilities.set_message (&#039;maint_postscript&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local Archived;&lt;br /&gt;
	if utilities.is_set (ArchiveURL) then&lt;br /&gt;
		if not utilities.is_set (ArchiveDate) then								-- ArchiveURL set but ArchiveDate not set&lt;br /&gt;
			utilities.set_message (&#039;err_archive_missing_date&#039;);					-- emit an error message&lt;br /&gt;
			ArchiveURL = &#039;&#039;;													-- empty string for concatenation&lt;br /&gt;
			ArchiveDate = &#039;&#039;;													-- empty string for concatenation&lt;br /&gt;
		end&lt;br /&gt;
	else														&lt;br /&gt;
		if utilities.is_set (ArchiveDate) then									-- ArchiveURL not set but ArchiveDate is set&lt;br /&gt;
			utilities.set_message (&#039;err_archive_date_missing_url&#039;);				-- emit an error message&lt;br /&gt;
			ArchiveURL = &#039;&#039;;													-- empty string for concatenation&lt;br /&gt;
			ArchiveDate = &#039;&#039;;													-- empty string for concatenation&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (ArchiveURL) then&lt;br /&gt;
		local arch_text;&lt;br /&gt;
		if &amp;quot;live&amp;quot; == UrlStatus then&lt;br /&gt;
			arch_text = cfg.messages[&#039;archived&#039;];&lt;br /&gt;
			if sepc ~= &amp;quot;.&amp;quot; then arch_text = arch_text:lower() end&lt;br /&gt;
			if utilities.is_set (ArchiveDate) then&lt;br /&gt;
				Archived = sepc .. &#039; &#039; .. utilities.substitute ( cfg.messages[&#039;archived-live&#039;],&lt;br /&gt;
					{external_link( ArchiveURL, arch_text, A:ORIGIN(&#039;ArchiveURL&#039;), nil) .. ArchiveFormat, ArchiveDate } );&lt;br /&gt;
			else&lt;br /&gt;
				Archived = &#039;&#039;;&lt;br /&gt;
			end&lt;br /&gt;
			if not utilities.is_set (OriginalURL) then&lt;br /&gt;
				utilities.set_message (&#039;err_archive_missing_url&#039;);&lt;br /&gt;
				Archived = &#039;&#039;;													-- empty string for concatenation&lt;br /&gt;
			end&lt;br /&gt;
		elseif utilities.is_set (OriginalURL) then								-- UrlStatus is empty, &#039;dead&#039;, &#039;unfit&#039;, &#039;usurped&#039;, &#039;bot: unknown&#039;&lt;br /&gt;
			if utilities.in_array (UrlStatus, {&#039;unfit&#039;, &#039;usurped&#039;, &#039;bot: unknown&#039;}) then&lt;br /&gt;
				arch_text = cfg.messages[&#039;archived-unfit&#039;];&lt;br /&gt;
				if sepc ~= &amp;quot;.&amp;quot; then arch_text = arch_text:lower() end&lt;br /&gt;
				Archived = sepc .. &#039; &#039; .. arch_text .. ArchiveDate;				-- format already styled&lt;br /&gt;
				if &#039;bot: unknown&#039; == UrlStatus then&lt;br /&gt;
					utilities.set_message (&#039;maint_bot_unknown&#039;);				-- and add a category if not already added&lt;br /&gt;
				else&lt;br /&gt;
					utilities.add_prop_cat (&#039;unfit&#039;);							-- and add a category if not already added&lt;br /&gt;
				end&lt;br /&gt;
			else																-- UrlStatus is empty, &#039;dead&#039;&lt;br /&gt;
				arch_text = cfg.messages[&#039;archived-dead&#039;];&lt;br /&gt;
				if sepc ~= &amp;quot;.&amp;quot; then arch_text = arch_text:lower() end&lt;br /&gt;
				if utilities.is_set (ArchiveDate) then&lt;br /&gt;
					Archived = sepc .. &amp;quot; &amp;quot; .. utilities.substitute ( arch_text,&lt;br /&gt;
						{ external_link( OriginalURL, cfg.messages[&#039;original&#039;], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } );	-- format already styled&lt;br /&gt;
				else&lt;br /&gt;
					Archived = &#039;&#039;;												-- unset for concatenation&lt;br /&gt;
				end&lt;br /&gt;
			end	&lt;br /&gt;
		else																	-- OriginalUrl not set&lt;br /&gt;
			utilities.set_message (&#039;err_archive_missing_url&#039;);&lt;br /&gt;
			Archived = &#039;&#039;;														-- empty string for concatenation&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (ArchiveFormat) then&lt;br /&gt;
		Archived = ArchiveFormat;												-- if set and ArchiveURL not set ArchiveFormat has error message&lt;br /&gt;
	else&lt;br /&gt;
		Archived = &#039;&#039;;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local TranscriptURL = A[&#039;TranscriptURL&#039;]&lt;br /&gt;
	local TranscriptFormat = A[&#039;TranscriptFormat&#039;];&lt;br /&gt;
	TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, &#039;transcript-format&#039;, &#039;transcripturl&#039;);&lt;br /&gt;
	local Transcript = A[&#039;Transcript&#039;];&lt;br /&gt;
	local TranscriptURL_origin = A:ORIGIN(&#039;TranscriptURL&#039;);						-- get name of parameter that holds TranscriptURL&lt;br /&gt;
	if utilities.is_set (Transcript) then&lt;br /&gt;
		if utilities.is_set (TranscriptURL) then&lt;br /&gt;
			Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );&lt;br /&gt;
		end&lt;br /&gt;
		Transcript = sepc .. &#039; &#039; .. Transcript .. TranscriptFormat;&lt;br /&gt;
	elseif utilities.is_set (TranscriptURL) then&lt;br /&gt;
		Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local Publisher;&lt;br /&gt;
	if utilities.is_set (PublicationDate) then&lt;br /&gt;
		PublicationDate = wrap_msg (&#039;published&#039;, PublicationDate);&lt;br /&gt;
	end&lt;br /&gt;
	if utilities.is_set (PublisherName) then&lt;br /&gt;
		if utilities.is_set (PublicationPlace) then&lt;br /&gt;
			Publisher = sepc .. &amp;quot; &amp;quot; .. PublicationPlace .. &amp;quot;: &amp;quot; .. PublisherName .. PublicationDate;&lt;br /&gt;
		else&lt;br /&gt;
			Publisher = sepc .. &amp;quot; &amp;quot; .. PublisherName .. PublicationDate;  &lt;br /&gt;
		end			&lt;br /&gt;
	elseif utilities.is_set (PublicationPlace) then &lt;br /&gt;
		Publisher= sepc .. &amp;quot; &amp;quot; .. PublicationPlace .. PublicationDate;&lt;br /&gt;
	else &lt;br /&gt;
		Publisher = PublicationDate;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Several of the above rely upon detecting this as nil, so do it last.&lt;br /&gt;
	if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then&lt;br /&gt;
		if utilities.is_set (Title) or utilities.is_set (TitleNote) then &lt;br /&gt;
			Periodical = sepc .. &amp;quot; &amp;quot; .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);&lt;br /&gt;
		else &lt;br /&gt;
			Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local Language = A[&#039;Language&#039;];&lt;br /&gt;
	if utilities.is_set (Language) then&lt;br /&gt;
		Language = language_parameter (Language);								-- format, categories, name from ISO639-1, etc.&lt;br /&gt;
	else&lt;br /&gt;
		Language=&#039;&#039;;															-- language not specified so make sure this is an empty string;&lt;br /&gt;
	--[[ TODO: need to extract the wrap_msg from language_parameter&lt;br /&gt;
	so that we can solve parentheses bunching problem with Format/Language/TitleType&lt;br /&gt;
	]]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	Handle the oddity that is cite speech.  This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be &amp;quot; (Speech)&amp;quot; so that&lt;br /&gt;
	the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).&lt;br /&gt;
	]]&lt;br /&gt;
	if &amp;quot;speech&amp;quot; == config.CitationClass then									-- cite speech only&lt;br /&gt;
		TitleNote = TitleType;													-- move TitleType to TitleNote so that it renders ahead of |event=&lt;br /&gt;
		TitleType = &#039;&#039;;															-- and unset&lt;br /&gt;
&lt;br /&gt;
		if utilities.is_set (Periodical) then									-- if Periodical, perhaps because of an included |website= or |journal= parameter &lt;br /&gt;
			if utilities.is_set (Conference) then								-- and if |event= is set&lt;br /&gt;
				Conference = Conference .. sepc .. &amp;quot; &amp;quot;;							-- then add appropriate punctuation to the end of the Conference variable before rendering&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Piece all bits together at last.  Here, all should be non-nil.&lt;br /&gt;
	-- We build things this way because it is more efficient in LUA&lt;br /&gt;
	-- not to keep reassigning to the same string variable over and over.&lt;br /&gt;
&lt;br /&gt;
	local tcommon;&lt;br /&gt;
	local tcommon2;																-- used for book cite when |contributor= is set&lt;br /&gt;
	&lt;br /&gt;
	if utilities.in_array (config.CitationClass, {&amp;quot;book&amp;quot;, &amp;quot;citation&amp;quot;}) and not utilities.is_set (Periodical) then		-- special cases for book cites&lt;br /&gt;
		if utilities.is_set (Contributors) then									-- when we are citing foreword, preface, introduction, etc.&lt;br /&gt;
			tcommon = safe_join ({Title, TitleNote}, sepc);						-- author and other stuff will come after this and before tcommon2&lt;br /&gt;
			tcommon2 = safe_join ({TitleType, Series, Language, Volume, Others, Edition, Publisher}, sepc);&lt;br /&gt;
		else&lt;br /&gt;
			tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Volume, Others, Edition, Publisher}, sepc);&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	elseif &#039;map&#039; == config.CitationClass then									-- special cases for cite map&lt;br /&gt;
		if utilities.is_set (Chapter) then										-- map in a book; TitleType is part of Chapter&lt;br /&gt;
			tcommon = safe_join ({Title, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);&lt;br /&gt;
		elseif utilities.is_set (Periodical) then								-- map in a periodical&lt;br /&gt;
			tcommon = safe_join ({Title, TitleType, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);&lt;br /&gt;
		else																	-- a sheet or stand-alone map&lt;br /&gt;
			tcommon = safe_join ({Title, TitleType, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc);&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
	elseif &#039;episode&#039; == config.CitationClass then								-- special case for cite episode&lt;br /&gt;
		tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc);&lt;br /&gt;
&lt;br /&gt;
	else																		-- all other CS1 templates&lt;br /&gt;
		tcommon = safe_join ({Title, TitleNote, Conference, Periodical, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if #ID_list &amp;gt; 0 then&lt;br /&gt;
		ID_list = safe_join( { sepc .. &amp;quot; &amp;quot;,  table.concat( ID_list, sepc .. &amp;quot; &amp;quot; ), ID }, sepc );&lt;br /&gt;
	else&lt;br /&gt;
		ID_list = ID;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local Via = A[&#039;Via&#039;];&lt;br /&gt;
	Via = utilities.is_set (Via) and  wrap_msg (&#039;via&#039;, Via) or &#039;&#039;;&lt;br /&gt;
	local idcommon;&lt;br /&gt;
	if &#039;audio-visual&#039; == config.CitationClass or &#039;episode&#039; == config.CitationClass then	-- special case for cite AV media &amp;amp; cite episode position transcript&lt;br /&gt;
		idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Quote }, sepc );&lt;br /&gt;
	else&lt;br /&gt;
		idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Quote }, sepc );&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local text;&lt;br /&gt;
	local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;&lt;br /&gt;
&lt;br /&gt;
	local OrigDate = A[&#039;OrigDate&#039;];&lt;br /&gt;
	OrigDate = utilities.is_set (OrigDate) and wrap_msg (&#039;origdate&#039;, OrigDate) or &#039;&#039;;&lt;br /&gt;
	if utilities.is_set (Date) then&lt;br /&gt;
		if utilities.is_set (Authors) or utilities.is_set (Editors) then		-- date follows authors or editors when authors not set&lt;br /&gt;
			Date = &amp;quot; (&amp;quot; .. Date .. &amp;quot;)&amp;quot; .. OrigDate .. sepc .. &amp;quot; &amp;quot;;				-- in parentheses&lt;br /&gt;
		else																	-- neither of authors and editors set&lt;br /&gt;
			if (string.sub(tcommon, -1, -1) == sepc) then						-- if the last character of tcommon is sepc&lt;br /&gt;
				Date = &amp;quot; &amp;quot; .. Date .. OrigDate;									-- Date does not begin with sepc&lt;br /&gt;
			else&lt;br /&gt;
				Date = sepc .. &amp;quot; &amp;quot; .. Date .. OrigDate;							-- Date begins with sepc&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
	if utilities.is_set (Authors) then&lt;br /&gt;
		if (not utilities.is_set (Date)) then									-- when date is set it&#039;s in parentheses; no Authors termination&lt;br /&gt;
			Authors = terminate_name_list (Authors, sepc);						-- when no date, terminate with 0 or 1 sepc and a space&lt;br /&gt;
		end&lt;br /&gt;
		if utilities.is_set (Editors) then&lt;br /&gt;
			local in_text = &#039;&#039;;&lt;br /&gt;
			local post_text = &#039;&#039;;&lt;br /&gt;
			if utilities.is_set (Chapter) and 0 == #c then&lt;br /&gt;
				in_text = cfg.messages[&#039;in&#039;] .. &#039; &#039;;&lt;br /&gt;
				if (sepc ~= &#039;.&#039;) then&lt;br /&gt;
					in_text = in_text:lower();									-- lowercase for cs2&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if EditorCount &amp;lt;= 1 then&lt;br /&gt;
				post_text = &#039; (&#039; .. cfg.messages[&#039;editor&#039;] .. &#039;)&#039;;				-- be consistent with no-author, no-date case&lt;br /&gt;
			else&lt;br /&gt;
				post_text = &#039; (&#039; .. cfg.messages[&#039;editors&#039;] .. &#039;)&#039;;&lt;br /&gt;
			end&lt;br /&gt;
			Editors = terminate_name_list (in_text .. Editors .. post_text, sepc);	-- terminate with 0 or 1 sepc and a space&lt;br /&gt;
		end&lt;br /&gt;
		if utilities.is_set (Contributors) then									-- book cite and we&#039;re citing the intro, preface, etc.&lt;br /&gt;
			local by_text = sepc .. &#039; &#039; .. cfg.messages[&#039;by&#039;] .. &#039; &#039;;&lt;br /&gt;
			if (sepc ~= &#039;.&#039;) then by_text = by_text:lower() end					-- lowercase for cs2&lt;br /&gt;
			Authors = by_text .. Authors;										-- author follows title so tweak it here&lt;br /&gt;
			if utilities.is_set (Editors) and utilities.is_set (Date) then		-- when Editors make sure that Authors gets terminated&lt;br /&gt;
				Authors = terminate_name_list (Authors, sepc);					-- terminate with 0 or 1 sepc and a space&lt;br /&gt;
			end&lt;br /&gt;
			if (not utilities.is_set (Date)) then								-- when date is set it&#039;s in parentheses; no Contributors termination&lt;br /&gt;
				Contributors = terminate_name_list (Contributors, sepc);		-- terminate with 0 or 1 sepc and a space&lt;br /&gt;
			end&lt;br /&gt;
			text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );&lt;br /&gt;
		else&lt;br /&gt;
			text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );&lt;br /&gt;
		end&lt;br /&gt;
	elseif utilities.is_set (Editors) then&lt;br /&gt;
		if utilities.is_set (Date) then&lt;br /&gt;
			if EditorCount &amp;lt;= 1 then&lt;br /&gt;
				Editors = Editors .. cfg.presentation[&#039;sep_name&#039;] .. cfg.messages[&#039;editor&#039;];&lt;br /&gt;
			else&lt;br /&gt;
				Editors = Editors .. cfg.presentation[&#039;sep_name&#039;] .. cfg.messages[&#039;editors&#039;];&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			if EditorCount &amp;lt;= 1 then&lt;br /&gt;
				Editors = Editors .. &amp;quot; (&amp;quot; .. cfg.messages[&#039;editor&#039;] .. &amp;quot;)&amp;quot; .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				Editors = Editors .. &amp;quot; (&amp;quot; .. cfg.messages[&#039;editors&#039;] .. &amp;quot;)&amp;quot; .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );&lt;br /&gt;
	else&lt;br /&gt;
		if utilities.in_array (config.CitationClass, {&amp;quot;journal&amp;quot;, &amp;quot;citation&amp;quot;}) and utilities.is_set (Periodical) then&lt;br /&gt;
			text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );&lt;br /&gt;
		else&lt;br /&gt;
			text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (PostScript) and PostScript ~= sepc then&lt;br /&gt;
		text = safe_join( {text, sepc}, sepc ); 								-- Deals with italics, spaces, etc.&lt;br /&gt;
		if &#039;.&#039; == sepc then														-- remove final seperator if present&lt;br /&gt;
			text = text:gsub (&#039;%&#039; .. sepc .. &#039;$&#039;, &#039;&#039;);							-- dot must be escaped here&lt;br /&gt;
		else&lt;br /&gt;
			text = mw.ustring.gsub (text, sepc .. &#039;$&#039;, &#039;&#039;);						-- using ustring for non-dot sepc (likely a non-Latin character)&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
	&lt;br /&gt;
	text = safe_join( {text, PostScript}, sepc );&lt;br /&gt;
&lt;br /&gt;
	-- Now enclose the whole thing in a &amp;lt;cite&amp;gt; element&lt;br /&gt;
	local options_t = {};&lt;br /&gt;
	options_t.class = cite_class_attribute_make (config.CitationClass, Mode);&lt;br /&gt;
&lt;br /&gt;
	local Ref = is_valid_parameter_value (A[&#039;Ref&#039;], A:ORIGIN(&#039;Ref&#039;), cfg.keywords_lists[&#039;ref&#039;], nil, true);	-- nil when |ref=harv; A[&#039;Ref&#039;] else&lt;br /&gt;
&lt;br /&gt;
	if &#039;none&#039; ~= cfg.keywords_xlate[(Ref and Ref:lower()) or &#039;&#039;] then&lt;br /&gt;
		local namelist_t = {};													-- holds selected contributor, author, editor name list&lt;br /&gt;
		local year = first_set ({Year, anchor_year}, 2);						-- Year first for legacy citations and for YMD dates that require disambiguation&lt;br /&gt;
&lt;br /&gt;
		if #c &amp;gt; 0 then															-- if there is a contributor list&lt;br /&gt;
			namelist_t = c;														-- select it&lt;br /&gt;
		elseif #a &amp;gt; 0 then														-- or an author list&lt;br /&gt;
			namelist_t = a;&lt;br /&gt;
		elseif #e &amp;gt; 0 then														-- or an editor list&lt;br /&gt;
			namelist_t = e;&lt;br /&gt;
		end&lt;br /&gt;
		local citeref_id;&lt;br /&gt;
		if #namelist_t &amp;gt; 0 then													-- if there are names in namelist_t&lt;br /&gt;
			citeref_id = make_citeref_id (namelist_t, year);					-- go make the CITEREF anchor&lt;br /&gt;
			if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or &#039;&#039;) then	-- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison&lt;br /&gt;
				utilities.set_message (&#039;maint_ref_duplicates_default&#039;);&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			citeref_id = &#039;&#039;;													-- unset&lt;br /&gt;
		end&lt;br /&gt;
		options_t.id = Ref or citeref_id;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if string.len (text:gsub(&#039;%b&amp;lt;&amp;gt;&#039;, &#039;&#039;)) &amp;lt;= 2 then								-- remove html and html-like tags; then get length of what remains; &lt;br /&gt;
		z.error_cats_t = {};													-- blank the categories list&lt;br /&gt;
		z.error_msgs_t = {};													-- blank the error messages list&lt;br /&gt;
		OCinSoutput = nil;														-- blank the metadata string&lt;br /&gt;
		text = &#039;&#039;;																-- blank the the citation&lt;br /&gt;
		utilities.set_message (&#039;err_empty_citation&#039;);							-- set empty citation message and category&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local render_t = {};														-- here we collect the final bits for concatenation into the rendered citation&lt;br /&gt;
&lt;br /&gt;
	if utilities.is_set (options_t.id) then										-- here we wrap the rendered citation in &amp;lt;cite ...&amp;gt;...&amp;lt;/cite&amp;gt; tags&lt;br /&gt;
		table.insert (render_t, utilities.substitute (cfg.presentation[&#039;cite-id&#039;], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text}));	-- when |ref= is set or when there is a namelist&lt;br /&gt;
	else&lt;br /&gt;
		table.insert (render_t, utilities.substitute (cfg.presentation[&#039;cite&#039;], {mw.text.nowiki(options_t.class), text}));	-- when |ref=none or when namelist_t empty and |ref= is missing or is empty&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	if OCinSoutput then															-- blanked when citation is &#039;empty&#039; so don&#039;t bother to add boilerplate metadata span&lt;br /&gt;
		table.insert (render_t, utilities.substitute (cfg.presentation[&#039;ocins&#039;], OCinSoutput));	-- format and append metadata to the citation&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local template_name = (&#039;citation&#039; == config.CitationClass) and &#039;citation&#039; or &#039;cite &#039; .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);&lt;br /&gt;
	local template_link = &#039;[[Template:&#039; .. template_name .. &#039;|&#039; .. template_name .. &#039;]]&#039;;&lt;br /&gt;
	local msg_prefix = &#039;&amp;lt;code class=&amp;quot;cs1-code&amp;quot;&amp;gt;{{&#039; .. template_link .. &#039;}}&amp;lt;/code&amp;gt;: &#039;;&lt;br /&gt;
&lt;br /&gt;
	if 0 ~= #z.error_msgs_t then&lt;br /&gt;
		mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));&lt;br /&gt;
&lt;br /&gt;
		table.insert (render_t, &#039; &#039;);											-- insert a space between citation and its error messages&lt;br /&gt;
		table.sort (z.error_msgs_t);											-- sort the error messages list; sorting includes wrapping &amp;lt;span&amp;gt; and &amp;lt;code&amp;gt; tags; hidden-error sorts ahead of visible-error&lt;br /&gt;
&lt;br /&gt;
		local hidden = true;													-- presume that the only error messages emited by this template are hidden&lt;br /&gt;
		for _, v in ipairs (z.error_msgs_t) do									-- spin through the list of error messages&lt;br /&gt;
			if v:find (&#039;cs1-visible-error&#039;, 1, true) then						-- look for the visible error class name&lt;br /&gt;
				hidden = false;													-- found one; so don&#039;t hide the error message prefix&lt;br /&gt;
				break;															-- and done because no need to look further&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]});	-- add error message prefix to first error message to prevent extraneous punctuation&lt;br /&gt;
		table.insert (render_t, table.concat (z.error_msgs_t, &#039;; &#039;));			-- make a big string of error messages and add it to the rendering&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if 0 ~= #z.maint_cats_t then&lt;br /&gt;
		mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));&lt;br /&gt;
&lt;br /&gt;
		table.sort (z.maint_cats_t);											-- sort the maintenance messages list&lt;br /&gt;
&lt;br /&gt;
		local maint_msgs_t = {};												-- here we collect all of the maint messages&lt;br /&gt;
&lt;br /&gt;
		if 0 == #z.error_msgs_t then											-- if no error messages&lt;br /&gt;
			table.insert (maint_msgs_t, msg_prefix);							-- insert message prefix in maint message livery&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		for _, v in ipairs( z.maint_cats_t ) do									-- append maintenance categories&lt;br /&gt;
			table.insert (maint_msgs_t, 										-- assemble new maint message and add it to the maint_msgs_t table&lt;br /&gt;
				table.concat ({v, &#039; (&#039;, utilities.substitute (cfg.messages[&#039;:cat wikilink&#039;], v), &#039;)&#039;})&lt;br /&gt;
				);&lt;br /&gt;
		end&lt;br /&gt;
		table.insert (render_t, utilities.substitute (cfg.presentation[&#039;hidden-maint&#039;], table.concat (maint_msgs_t, &#039; &#039;)));	-- wrap the group of maint messages with proper presentation and save&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not no_tracking_cats then&lt;br /&gt;
		local sort_key;&lt;br /&gt;
		local cat_wikilink = &#039;cat wikilink&#039;;&lt;br /&gt;
		if cfg.enable_sort_keys then											-- when namespace sort keys enabled&lt;br /&gt;
			local namespace_number = mw.title.getCurrentTitle().namespace;		-- get namespace number for this wikitext&lt;br /&gt;
			sort_key = (0 ~= namespace_number and (cfg.name_space_sort_keys[namespace_number] or cfg.name_space_sort_keys.other)) or nil;	-- get sort key character; nil for mainspace&lt;br /&gt;
			cat_wikilink = (not sort_key and &#039;cat wikilink&#039;) or &#039;cat wikilink sk&#039;;	-- make &amp;lt;cfg.messages&amp;gt; key&lt;br /&gt;
		end				&lt;br /&gt;
&lt;br /&gt;
		for _, v in ipairs (z.error_cats_t) do									-- append error categories&lt;br /&gt;
			table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));&lt;br /&gt;
		end&lt;br /&gt;
		if cfg.id_limits_data_load_fail then									-- boolean true when load failed&lt;br /&gt;
			utilities.set_message (&#039;maint_id_limit_load_fail&#039;);					-- done here because this maint cat emits no message&lt;br /&gt;
		end&lt;br /&gt;
		for _, v in ipairs (z.maint_cats_t) do									-- append maintenance categories&lt;br /&gt;
			table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));&lt;br /&gt;
		end&lt;br /&gt;
		for _, v in ipairs (z.prop_cats_t) do									-- append properties categories&lt;br /&gt;
			table.insert (render_t, utilities.substitute (cfg.messages[&#039;cat wikilink&#039;], v));	-- no sort keys&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat (render_t);												-- make a big string and done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; V A L I D A T E &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Looks for a parameter&#039;s name in one of several whitelists.&lt;br /&gt;
&lt;br /&gt;
Parameters in the whitelist can have three values:&lt;br /&gt;
	true - active, supported parameters&lt;br /&gt;
	false - deprecated, supported parameters&lt;br /&gt;
	nil - unsupported parameters&lt;br /&gt;
	&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function validate (name, cite_class, empty)&lt;br /&gt;
	local name = tostring (name);&lt;br /&gt;
	local enum_name;															-- parameter name with enumerator (if any) replaced with &#039;#&#039;&lt;br /&gt;
	local state;&lt;br /&gt;
	local function state_test (state, name)										-- local function to do testing of state values&lt;br /&gt;
		if true == state then return true; end									-- valid actively supported parameter&lt;br /&gt;
		if false == state then&lt;br /&gt;
			if empty then return nil; end										-- empty deprecated parameters are treated as unknowns&lt;br /&gt;
			deprecated_parameter (name);										-- parameter is deprecated but still supported&lt;br /&gt;
			return true;&lt;br /&gt;
		end&lt;br /&gt;
		if &#039;tracked&#039; == state then&lt;br /&gt;
			local base_name = name:gsub (&#039;%d&#039;, &#039;&#039;);								-- strip enumerators from parameter names that have them to get the base name&lt;br /&gt;
			utilities.add_prop_cat (&#039;tracked-param&#039;, {base_name}, base_name);	-- add a properties category; &amp;lt;base_name&amp;gt; modifies &amp;lt;key&amp;gt;&lt;br /&gt;
			return true;&lt;br /&gt;
		end&lt;br /&gt;
		return nil;&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	if name:find (&#039;#&#039;) then														-- # is a cs1|2 reserved character so parameters with # not permitted&lt;br /&gt;
		return nil;&lt;br /&gt;
	end&lt;br /&gt;
																				-- replace enumerator digit(s) with # (|last25= becomes |last#=) (mw.ustring because non-Western &#039;local&#039; digits)&lt;br /&gt;
	enum_name = mw.ustring.gsub (name, &#039;%d+$&#039;, &#039;#&#039;);							-- where enumerator is last charaters in parameter name (these to protect |s2cid=)&lt;br /&gt;
	enum_name = mw.ustring.gsub (enum_name, &#039;%d+([%-l])&#039;, &#039;#%1&#039;);				-- where enumerator is in the middle of the parameter name; |author#link= is the oddity&lt;br /&gt;
&lt;br /&gt;
	if &#039;document&#039; == cite_class then											-- special case for {{cite document}}&lt;br /&gt;
		state = whitelist.document_parameters_t[enum_name];						-- this list holds enumerated and nonenumerated parameters&lt;br /&gt;
		if true == state_test (state, name) then return true; end&lt;br /&gt;
		&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if utilities.in_array (cite_class, whitelist.preprint_template_list_t) then	-- limited parameter sets allowed for these templates&lt;br /&gt;
		state = whitelist.limited_parameters_t[enum_name];						-- this list holds enumerated and nonenumerated parameters&lt;br /&gt;
		if true == state_test (state, name) then return true; end&lt;br /&gt;
&lt;br /&gt;
		state = whitelist.preprint_arguments_t[cite_class][name];				-- look in the parameter-list for the template identified by cite_class&lt;br /&gt;
		if true == state_test (state, name) then return true; end&lt;br /&gt;
&lt;br /&gt;
		return false;															-- not supported because not found or name is set to nil&lt;br /&gt;
	end																			-- end limited parameter-set templates&lt;br /&gt;
&lt;br /&gt;
	if utilities.in_array (cite_class, whitelist.unique_param_template_list_t) then 	-- template-specific parameters for templates that accept parameters from the basic argument list&lt;br /&gt;
		state = whitelist.unique_arguments_t[cite_class][name];					-- look in the template-specific parameter-lists for the template identified by cite_class&lt;br /&gt;
		if true == state_test (state, name) then return true; end&lt;br /&gt;
	end																			-- if here, fall into general validation&lt;br /&gt;
&lt;br /&gt;
	state = whitelist.common_parameters_t[enum_name];							-- all other templates; all normal parameters allowed; this list holds enumerated and nonenumerated parameters&lt;br /&gt;
	if true == state_test (state, name) then return true; end&lt;br /&gt;
&lt;br /&gt;
	return false;																-- not supported because not found or name is set to nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; I N T E R _ W I K I _ C H E C K &amp;gt;----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
check &amp;lt;value&amp;gt; for inter-language interwiki-link markup.  &amp;lt;prefix&amp;gt; must be a MediaWiki-recognized language&lt;br /&gt;
code.  when these values have the form (without leading colon):&lt;br /&gt;
	[[&amp;lt;prefix&amp;gt;:link|label]] return label as plain-text&lt;br /&gt;
	[[&amp;lt;prefix&amp;gt;:link]] return &amp;lt;prefix&amp;gt;:link as plain-text&lt;br /&gt;
&lt;br /&gt;
return value as is else&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function inter_wiki_check (parameter, value)&lt;br /&gt;
	local prefix = value:match (&#039;%[%[(%a+):&#039;);									-- get an interwiki prefix if one exists&lt;br /&gt;
	local _;&lt;br /&gt;
	&lt;br /&gt;
	if prefix and cfg.inter_wiki_map[prefix:lower()] then						-- if prefix is in the map, needs preceding colon so&lt;br /&gt;
		utilities.set_message (&#039;err_bad_paramlink&#039;, parameter);					-- emit an error message&lt;br /&gt;
		_, value, _ = utilities.is_wikilink (value);							-- extract label portion from wikilink&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return value;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; M I S S I N G _ P I P E _ C H E C K &amp;gt;------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal&lt;br /&gt;
sign, compare the alphanumeric string to the list of cs1|2 parameters.  If found, then the string is possibly a&lt;br /&gt;
parameter that is missing its pipe.  There are two tests made:&lt;br /&gt;
	{{cite ... |title=Title access-date=2016-03-17}}	-- the first parameter has a value and whitespace separates that value from the missing pipe parameter name&lt;br /&gt;
	{{cite ... |title=access-date=2016-03-17}}			-- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)&lt;br /&gt;
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc.  To prevent false positives XML/HTML&lt;br /&gt;
tags are removed before the search.&lt;br /&gt;
&lt;br /&gt;
If a missing pipe is detected, this function adds the missing pipe maintenance category.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function missing_pipe_check (parameter, value)&lt;br /&gt;
	local capture;&lt;br /&gt;
	value = value:gsub (&#039;%b&amp;lt;&amp;gt;&#039;, &#039;&#039;);											-- remove XML/HTML tags because attributes: class=, title=, etc.&lt;br /&gt;
&lt;br /&gt;
	capture = value:match (&#039;%s+(%a[%w%-]+)%s*=&#039;) or value:match (&#039;^(%a[%w%-]+)%s*=&#039;);	-- find and categorize parameters with possible missing pipes&lt;br /&gt;
	if capture and validate (capture) then										-- if the capture is a valid parameter name&lt;br /&gt;
		utilities.set_message (&#039;err_missing_pipe&#039;, parameter);&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; H A S _ E X T R A N E O U S _ P U N C T &amp;gt;--------------------------------------&lt;br /&gt;
&lt;br /&gt;
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function has_extraneous_punc (param, value)&lt;br /&gt;
	if &#039;number&#039; == type (param) then&lt;br /&gt;
		return;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	param = param:gsub (&#039;%d+&#039;, &#039;#&#039;);											-- enumerated name-list mask params allow terminal punct; normalize &lt;br /&gt;
	if cfg.punct_skip[param] then&lt;br /&gt;
		return;																	-- parameter name found in the skip table so done&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if value:match (&#039;[,;:]$&#039;) then&lt;br /&gt;
		utilities.set_message (&#039;maint_extra_punct&#039;);							-- has extraneous punctuation; add maint cat&lt;br /&gt;
	end&lt;br /&gt;
	if value:match (&#039;^=&#039;) then													-- sometimes an extraneous &#039;=&#039; character appears ...&lt;br /&gt;
		utilities.set_message (&#039;maint_extra_punct&#039;);							-- has extraneous punctuation; add maint cat&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; H A S _ T W L _ U R L &amp;gt;--------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
look for The Wikipedia Library urls in url-holding parameters.  TWL urls are accessible only for readers who are&lt;br /&gt;
active extended confirmed Wikipedia editors.  This function sets an error message when such urls are discovered&lt;br /&gt;
and when appropriate, sets the |&amp;lt;param&amp;gt;-url-access=subscription.  returns nothing.&lt;br /&gt;
&lt;br /&gt;
looks for: &#039;.wikipedialibrary.idm.oclc.org&#039;&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function has_twl_url (url_params_t, cite_args_t)&lt;br /&gt;
	local url_error_t = {};														-- sequence of url-holding parameters that have a TWL url&lt;br /&gt;
	&lt;br /&gt;
	for param, value in pairs (url_params_t) do&lt;br /&gt;
		if value:find (&#039;%.wikipedialibrary%.idm%.oclc%.org&#039;) then				-- has the TWL base url?&lt;br /&gt;
			table.insert (url_error_t, param);									-- add parameter name to the error list&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if 0 ~= #url_error_t then													-- non-zero when there are errors&lt;br /&gt;
		table.sort (url_error_t);												-- sor for error messaging&lt;br /&gt;
		for i, param in ipairs (url_error_t) do&lt;br /&gt;
			if cfg.url_access_map_t[param] then									-- if &amp;lt;param&amp;gt; has a matching -access parameter&lt;br /&gt;
				cite_args_t[cfg.url_access_map_t[param]] = cfg.keywords_xlate.subscription;	-- set |&amp;lt;param&amp;gt;-url-access=subscription&lt;br /&gt;
			end&lt;br /&gt;
			url_error_t[i] = utilities.wrap_style (&#039;parameter&#039;, param);			-- make the parameter pretty for error message&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		utilities.set_message (&#039;err_param_has_twl_url&#039;, {utilities.make_sep_list (#url_error_t, url_error_t)});	-- add this error message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; H A S _ E X T R A N E O U S _ U R L &amp;gt;------------------------------------------&lt;br /&gt;
&lt;br /&gt;
look for extraneous url parameter values; parameters listed in skip table are not checked&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function has_extraneous_url (non_url_param_t)&lt;br /&gt;
	local url_error_t = {};&lt;br /&gt;
	&lt;br /&gt;
	check_for_url (non_url_param_t, url_error_t);								-- extraneous url check&lt;br /&gt;
	if 0 ~= #url_error_t then													-- non-zero when there are errors&lt;br /&gt;
		table.sort (url_error_t);&lt;br /&gt;
		utilities.set_message (&#039;err_param_has_ext_link&#039;, {utilities.make_sep_list (#url_error_t, url_error_t)});	-- add this error message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; _ C I T A T I O N &amp;gt;------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Module entry point&lt;br /&gt;
&lt;br /&gt;
	frame – from template call (citation()); may be nil when called from another module&lt;br /&gt;
	args_t – table of all cs1|2 parameters in the template (the parent frame)&lt;br /&gt;
	config_t – table of template-supplied parameter (the #invoke frame)&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function _citation (frame, args_t, config_t)								-- save a copy in case we need to display an error message in preview mode&lt;br /&gt;
	if not frame then&lt;br /&gt;
		frame = mw.getCurrentFrame();											-- if called from another module, get a frame for frame-provided functions&lt;br /&gt;
	end&lt;br /&gt;
																				-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)&lt;br /&gt;
	local sandbox = ((config_t.SandboxPath and &#039;&#039; ~= config_t.SandboxPath) and config_t.SandboxPath) or &#039;/sandbox&#039;;	-- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}&lt;br /&gt;
	is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true);		-- is this invoke the sandbox module?&lt;br /&gt;
	sandbox = is_sandbox and sandbox or &#039;&#039;;										-- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else&lt;br /&gt;
&lt;br /&gt;
	cfg = mw.loadData (&#039;Module:Citation/CS1/Configuration&#039; .. sandbox);			-- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else&lt;br /&gt;
	whitelist = mw.loadData (&#039;Module:Citation/CS1/Whitelist&#039; .. sandbox);&lt;br /&gt;
	utilities = require (&#039;Module:Citation/CS1/Utilities&#039; .. sandbox);&lt;br /&gt;
	validation = require (&#039;Module:Citation/CS1/Date_validation&#039; .. sandbox);&lt;br /&gt;
	identifiers = require (&#039;Module:Citation/CS1/Identifiers&#039; .. sandbox);&lt;br /&gt;
	metadata = require (&#039;Module:Citation/CS1/COinS&#039; .. sandbox);&lt;br /&gt;
&lt;br /&gt;
	utilities.set_selected_modules (cfg);										-- so that functions in Utilities can see the selected cfg tables&lt;br /&gt;
	identifiers.set_selected_modules (cfg, utilities);							-- so that functions in Identifiers can see the selected cfg tables and selected Utilities module&lt;br /&gt;
	validation.set_selected_modules (cfg, utilities);							-- so that functions in Date validataion can see selected cfg tables and the selected Utilities module&lt;br /&gt;
	metadata.set_selected_modules (cfg, utilities);								-- so that functions in COinS can see the selected cfg tables and selected Utilities module&lt;br /&gt;
&lt;br /&gt;
	z = utilities.z;															-- table of error and category tables in Module:Citation/CS1/Utilities&lt;br /&gt;
	local cite_args_t = {};														-- because args_t is the parent (template) frame args (which cannot be modified); params and their values will be placed here&lt;br /&gt;
&lt;br /&gt;
	is_preview_mode = not utilities.is_set (frame:preprocess (&#039;{{REVISIONID}}&#039;));&lt;br /&gt;
&lt;br /&gt;
	local suggestions = {};														-- table where we store suggestions if we need to loadData them&lt;br /&gt;
	local error_text;															-- used as a flag&lt;br /&gt;
&lt;br /&gt;
	local capture;																-- the single supported capture when matching unknown parameters using patterns&lt;br /&gt;
	local empty_unknowns = {};													-- sequence table to hold empty unknown params for error message listing&lt;br /&gt;
	for k, v in pairs (args_t) do												-- get parameters from the parent (template) frame&lt;br /&gt;
		v = mw.ustring.gsub (v, &#039;^%s*(.-)%s*$&#039;, &#039;%1&#039;);							-- trim leading/trailing whitespace; when v is only whitespace, becomes empty string&lt;br /&gt;
		if v ~= &#039;&#039; then&lt;br /&gt;
			if (&#039;string&#039; == type (k)) then&lt;br /&gt;
				k = mw.ustring.gsub (k, &#039;%d&#039;, cfg.date_names.local_digits);		-- for enumerated parameters, translate &#039;local&#039; digits to Western 0-9&lt;br /&gt;
			end&lt;br /&gt;
			if not validate( k, config_t.CitationClass ) then			&lt;br /&gt;
				if type (k) ~= &#039;string&#039; then									-- exclude empty numbered parameters&lt;br /&gt;
					if v:match(&amp;quot;%S+&amp;quot;) ~= nil then&lt;br /&gt;
						error_text = utilities.set_message (&#039;err_text_ignored&#039;, {v});&lt;br /&gt;
					end&lt;br /&gt;
				elseif validate (k:lower(), config_t.CitationClass) then &lt;br /&gt;
					error_text = utilities.set_message (&#039;err_parameter_ignored_suggest&#039;, {k, k:lower()});	-- suggest the lowercase version of the parameter&lt;br /&gt;
				else&lt;br /&gt;
					if nil == suggestions.suggestions then						-- if this table is nil then we need to load it&lt;br /&gt;
						suggestions = mw.loadData (&#039;Module:Citation/CS1/Suggestions&#039; .. sandbox);	--load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else&lt;br /&gt;
					end&lt;br /&gt;
					for pattern, param in pairs (suggestions.patterns) do		-- loop through the patterns to see if we can suggest a proper parameter&lt;br /&gt;
						capture = k:match (pattern);							-- the whole match if no capture in pattern else the capture if a match&lt;br /&gt;
						if capture then											-- if the pattern matches &lt;br /&gt;
							param = utilities.substitute (param, capture);		-- add the capture to the suggested parameter (typically the enumerator)&lt;br /&gt;
							if validate (param, config_t.CitationClass) then		-- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)&lt;br /&gt;
								error_text = utilities.set_message (&#039;err_parameter_ignored_suggest&#039;, {k, param});	-- set the suggestion error message&lt;br /&gt;
							else&lt;br /&gt;
								error_text = utilities.set_message (&#039;err_parameter_ignored&#039;, {k});	-- suggested param not supported by this template&lt;br /&gt;
								v = &#039;&#039;;											-- unset&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					if not utilities.is_set (error_text) then					-- couldn&#039;t match with a pattern, is there an explicit suggestion?						&lt;br /&gt;
						if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config_t.CitationClass) then&lt;br /&gt;
							utilities.set_message (&#039;err_parameter_ignored_suggest&#039;, {k, suggestions.suggestions[ k:lower() ]});&lt;br /&gt;
						else&lt;br /&gt;
							utilities.set_message (&#039;err_parameter_ignored&#039;, {k});&lt;br /&gt;
							v = &#039;&#039;;												-- unset value assigned to unrecognized parameters (this for the limited parameter lists)&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end				  &lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			cite_args_t[k] = v;													-- save this parameter and its value&lt;br /&gt;
&lt;br /&gt;
		elseif not utilities.is_set (v) then									-- for empty parameters&lt;br /&gt;
			if not validate (k, config_t.CitationClass, true) then				-- is this empty parameter a valid parameter&lt;br /&gt;
				k = (&#039;&#039; == k) and &#039;(empty string)&#039; or k;						-- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text&lt;br /&gt;
				table.insert (empty_unknowns, utilities.wrap_style (&#039;parameter&#039;, k));	-- format for error message and add to the list&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
&lt;br /&gt;
	if 0 ~= #empty_unknowns then												-- create empty unknown error message&lt;br /&gt;
		utilities.set_message (&#039;err_param_unknown_empty&#039;, {&lt;br /&gt;
			1 == #empty_unknowns and &#039;&#039; or &#039;s&#039;,&lt;br /&gt;
			utilities.make_sep_list (#empty_unknowns, empty_unknowns)&lt;br /&gt;
			});&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local non_url_param_t = {};													-- table of parameters and values that are not url-holding parameters&lt;br /&gt;
	local url_param_t = {};														-- table of url-holding paramters and their values&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs (cite_args_t) do&lt;br /&gt;
&lt;br /&gt;
		if &#039;string&#039; == type (k) then											-- don&#039;t evaluate positional parameters&lt;br /&gt;
			has_invisible_chars (k, v);											-- look for invisible characters&lt;br /&gt;
		end&lt;br /&gt;
		has_extraneous_punc (k, v);												-- look for extraneous terminal punctuation in parameter values&lt;br /&gt;
		missing_pipe_check (k, v);												-- do we think that there is a parameter that is missing a pipe?&lt;br /&gt;
		cite_args_t[k] = inter_wiki_check (k, v);								-- when language interwiki-linked parameter missing leading colon replace with wiki-link label&lt;br /&gt;
&lt;br /&gt;
		if &#039;string&#039; == type (k) then											-- when parameter k is not positional&lt;br /&gt;
			if not cfg.url_skip[k] then											-- and not in url skip table&lt;br /&gt;
				non_url_param_t[k] = v;											-- make a parameter/value list for extraneous url check&lt;br /&gt;
			else																-- and is in url skip table (a url-holding parameter)&lt;br /&gt;
				url_param_t[k] = v;												-- make a parameter/value list to check for values that are The Wikipedia Library url&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	has_extraneous_url (non_url_param_t);										-- look for url in parameter values where a url does not belong&lt;br /&gt;
	has_twl_url (url_param_t, cite_args_t);										-- look for url-holding parameters that hold a The Wikipedia Library url&lt;br /&gt;
&lt;br /&gt;
	return table.concat ({&lt;br /&gt;
		frame:extensionTag (&#039;templatestyles&#039;, &#039;&#039;, {src=&#039;Module:Citation/CS1&#039; .. sandbox .. &#039;/styles.css&#039;}),&lt;br /&gt;
		citation0 (config_t, cite_args_t)&lt;br /&gt;
	});&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C I T A T I O N &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Template entry point&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function citation (frame)&lt;br /&gt;
	local config_t = {};														-- table to store parameters from the module {{#invoke:}}&lt;br /&gt;
	local args_t = frame:getParent().args;										-- get template&#039;s preset parameters&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs (frame.args) do											-- get parameters from the {{#invoke}} frame&lt;br /&gt;
		config_t[k] = v;&lt;br /&gt;
	--	args_t[k] = v;															-- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?&lt;br /&gt;
	end	&lt;br /&gt;
	return _citation (frame, args_t, config_t)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T E D   F U N C T I O N S &amp;gt;------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	citation = citation,														-- template entry point&lt;br /&gt;
	&lt;br /&gt;
	_citation = _citation,														-- module entry point&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E9%A6%96%E9%A1%B5&amp;diff=426</id>
		<title>首页</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E9%A6%96%E9%A1%B5&amp;diff=426"/>
		<updated>2025-06-20T17:08:41Z</updated>

		<summary type="html">&lt;p&gt;Admin：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= 欢迎来到中国知名企业家百科 =&lt;br /&gt;
&lt;br /&gt;
这里收录了{{PLURAL:{{NUMBEROFARTICLES}}|1位|{{NUMBEROFARTICLES}}位}}中国著名企业家的资料，涵盖科技、互联网、制造、地产等多个领域。&lt;br /&gt;
&lt;br /&gt;
== 🔹 精选人物 ==&lt;br /&gt;
* [[马云]] – 阿里巴巴集团创始人&lt;br /&gt;
* [[马化腾]] – 腾讯公司创始人&lt;br /&gt;
* [[任正非]] – 华为公司创始人&lt;br /&gt;
* [[李彦宏]] – 百度公司创始人&lt;br /&gt;
* [[雷军]] – 小米公司创始人&lt;br /&gt;
* [[张一鸣]] – 字节跳动创始人&lt;br /&gt;
* [[王健林]] – 万达集团创始人&lt;br /&gt;
* [[许家印]] – 恒大集团董事长&lt;br /&gt;
* [[柳传志]] – 联想集团创始人&lt;br /&gt;
&lt;br /&gt;
== 🔹 企业家分类 ==&lt;br /&gt;
* [[:分类:企业家]]&lt;br /&gt;
* [[:分类:互联网人物]]&lt;br /&gt;
* [[:分类:制造业人物]]&lt;br /&gt;
* [[:分类:房地产人物]]&lt;br /&gt;
&lt;br /&gt;
== 🔹 最近更新的页面 ==&lt;br /&gt;
&amp;lt;recentchanges limit=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 🔹 快速链接 ==&lt;br /&gt;
* [[Special:AllPages|所有页面]]&lt;br /&gt;
* [[Special:Categories|所有分类]]&lt;br /&gt;
* [[Special:Random|随机页面]]&lt;br /&gt;
* [[Special:RecentChanges|最近更改]]&lt;br /&gt;
* [[Special:Statistics|站点统计]]&lt;br /&gt;
&lt;br /&gt;
== 🔹 如何参与 ==&lt;br /&gt;
欢迎您参与编辑和完善本百科内容！请先阅读 [[Help:Editing|编辑帮助]] 以了解如何参与。&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;本百科目前包含 {{NUMBEROFARTICLES}} 个页面，由社区共同维护。&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;已安装MediaWiki。&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
请查阅[https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents 用户指导]以获取使用本wiki软件的信息。&lt;br /&gt;
&lt;br /&gt;
== 入门 ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings MediaWiki配置设置列表]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ/zh-hans MediaWiki常见问题]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki发布邮件列表]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources 本地化MediaWiki到您的语言]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam 了解如何在您的wiki上打击破坏]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:ISO_639_name_zh&amp;diff=425</id>
		<title>模板:ISO 639 name zh</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:ISO_639_name_zh&amp;diff=425"/>
		<updated>2025-06-20T17:02:26Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;中文&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{ISO 639 name conversion template doc|{{ {{PAGENAME}} }}|zh}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Zh-hant&amp;diff=423</id>
		<title>模板:Zh-hant</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:Zh-hant&amp;diff=423"/>
		<updated>2025-06-20T17:02:26Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{language icon|zh|{{Lan|zh=繁體中文|zh-hans=繁体中文|zh-hant=繁體中文}}}}&amp;lt;noinclude&amp;gt;[[Category:语言标示模板|{{PAGENAME}}]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:URL&amp;diff=421</id>
		<title>模板:URL</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:URL&amp;diff=421"/>
		<updated>2025-06-20T17:02:26Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:URL|url|1={{{1|}}}|2={{{2|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:MONTHNUMBER&amp;diff=419</id>
		<title>模板:MONTHNUMBER</title>
		<link rel="alternate" type="text/html" href="https://www.wikiw.cn/index.php?title=%E6%A8%A1%E6%9D%BF:MONTHNUMBER&amp;diff=419"/>
		<updated>2025-06-20T17:02:26Z</updated>

		<summary type="html">&lt;p&gt;Admin：​导入1个版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#if:{{{1|}}}|{{#switch:{{lc:{{{1}}}}}|january|一月|jan=1|february|二月|feb=2|march|三月|mar=3|apr|四月|april=4|五月|may=5|june|六月|jun=6|july|七月|jul=7|august|八月|aug=8|september|九月|sep=9|october|十月|oct=10|november|十一月|nov=11|december|十二月|dec=12|{{#ifexpr:{{{1}}}&amp;lt;0|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}}}|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}}}}}|Missing required parameter 1=&#039;&#039;month&#039;&#039;!}}&amp;lt;noinclude&amp;gt;{{doc}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>