<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://test.zybkcn.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AYesno%2Fdoc</id>
	<title>Module:Yesno/doc - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://test.zybkcn.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AYesno%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;action=history"/>
	<updated>2026-07-18T04:05:44Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=589&amp;oldid=prev</id>
		<title>2026年6月21日 (日) 01:08 鹿野耕云</title>
		<link rel="alternate" type="text/html" href="https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=589&amp;oldid=prev"/>
		<updated>2026-06-21T01:08:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年6月21日 (日) 09:08的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;本模块提供用于处理&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/del&gt;布尔值&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;或形似布尔值的字符串输入的统一接口。Lua 允许使用 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 布尔值，而 wiki 模板仅能通过 &quot;yes&quot;、&quot;no&quot; 等字符串表达布尔值。本模块将这些字符串转换为 Lua 可处理的布尔值。对于 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 输入，仍返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;，以便区分 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;。本模块同样接受 Lua 自身的结构（布尔值、数字、表、函数）作为输入。如果传入的值无法识别，可指定一个返回的默认值。&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;本模块提供用于处理布尔值或形似布尔值的字符串输入的统一接口。Lua 允许使用 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 布尔值，而 wiki 模板仅能通过 &quot;yes&quot;、&quot;no&quot; 等字符串表达布尔值。本模块将这些字符串转换为 Lua 可处理的布尔值。对于 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 输入，仍返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;，以便区分 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;。本模块同样接受 Lua 自身的结构（布尔值、数字、表、函数）作为输入。如果传入的值无法识别，可指定一个返回的默认值。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 语法 ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 语法 ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key zybkcn_com:diff:1.41:old-585:rev-589:wikidiff2=table:1.14.2:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>鹿野耕云</name></author>
	</entry>
	<entry>
		<id>https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=585&amp;oldid=prev</id>
		<title>WikiBot：​移除不存在的头部模板标记</title>
		<link rel="alternate" type="text/html" href="https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=585&amp;oldid=prev"/>
		<updated>2026-06-20T16:32:17Z</updated>

		<summary type="html">&lt;p&gt;移除不存在的头部模板标记&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年6月21日 (日) 00:32的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第51行：&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第51行：&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;lua&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&quot;lua&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;yesno(nil)&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;yesno(nil)&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;yesno()&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第105行：&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第104行：&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;尽管空字符串在 wikitext 中通常等价于 false，但 Lua 视其为非空&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;字符串&lt;/del&gt;。本模块遵循 Lua 行为。如果需要将空字符串视为 false，请在传入前过滤，例如 [[Module:Arguments]] 默认会移除空白参数。&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;尽管空字符串在 wikitext 中通常等价于 false，但 Lua 视其为非空。本模块遵循 Lua 行为。如果需要将空字符串视为 false，请在传入前过滤，例如 [[Module:Arguments]] 默认会移除空白参数。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== 处理 nil ===&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== 处理 nil ===&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key zybkcn_com:diff:1.41:old-583:rev-585:wikidiff2=table:1.14.2:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>WikiBot</name></author>
	</entry>
	<entry>
		<id>https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=583&amp;oldid=prev</id>
		<title>2026年6月20日 (六) 16:30 鹿野耕云</title>
		<link rel="alternate" type="text/html" href="https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=583&amp;oldid=prev"/>
		<updated>2026-06-20T16:30:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年6月21日 (日) 00:30的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{high-risk}}&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{module rating|protected}}&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;本模块提供用于处理[[布尔值]]或形似布尔值的字符串输入的统一接口。Lua 允许使用 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 布尔值，而 wiki 模板仅能通过 &quot;yes&quot;、&quot;no&quot; 等字符串表达布尔值。本模块将这些字符串转换为 Lua 可处理的布尔值。对于 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 输入，仍返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;，以便区分 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;。本模块同样接受 Lua 自身的结构（布尔值、数字、表、函数）作为输入。如果传入的值无法识别，可指定一个返回的默认值。&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;本模块提供用于处理[[布尔值]]或形似布尔值的字符串输入的统一接口。Lua 允许使用 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 布尔值，而 wiki 模板仅能通过 &quot;yes&quot;、&quot;no&quot; 等字符串表达布尔值。本模块将这些字符串转换为 Lua 可处理的布尔值。对于 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 输入，仍返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;，以便区分 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;。本模块同样接受 Lua 自身的结构（布尔值、数字、表、函数）作为输入。如果传入的值无法识别，可指定一个返回的默认值。&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key zybkcn_com:diff:1.41:old-578:rev-583:wikidiff2=table:1.14.2:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>鹿野耕云</name></author>
	</entry>
	<entry>
		<id>https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=578&amp;oldid=prev</id>
		<title>WikiBot：​基于 zhwiki 创建 Yesno 文档，补充 t/f/on/off 值</title>
		<link rel="alternate" type="text/html" href="https://test.zybkcn.com/w/index.php?title=Module:Yesno/doc&amp;diff=578&amp;oldid=prev"/>
		<updated>2026-06-20T15:56:58Z</updated>

		<summary type="html">&lt;p&gt;基于 zhwiki 创建 Yesno 文档，补充 t/f/on/off 值&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{high-risk}}&lt;br /&gt;
{{module rating|protected}}&lt;br /&gt;
本模块提供用于处理[[布尔值]]或形似布尔值的字符串输入的统一接口。Lua 允许使用 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 布尔值，而 wiki 模板仅能通过 &amp;quot;yes&amp;quot;、&amp;quot;no&amp;quot; 等字符串表达布尔值。本模块将这些字符串转换为 Lua 可处理的布尔值。对于 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 输入，仍返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;，以便区分 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 和 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;。本模块同样接受 Lua 自身的结构（布尔值、数字、表、函数）作为输入。如果传入的值无法识别，可指定一个返回的默认值。&lt;br /&gt;
&lt;br /&gt;
== 语法 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;yesno(value, default)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; 是需要测试的值。布尔值输入或形似布尔值的输入（见下）总是视为 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; 或 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;，&amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 总是视为 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;，其他值一律返回 &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
== 用法 ==&lt;br /&gt;
&lt;br /&gt;
首先加载模块。注意只能由其他 Lua 模块加载，普通 wiki 页面请使用 {{tl|yesno}} 模板。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
以下值始终返回 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(&amp;#039;yes&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;y&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;true&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;t&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;on&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;1&amp;#039;)&lt;br /&gt;
yesno(1)&lt;br /&gt;
yesno(true)&lt;br /&gt;
yesno(&amp;#039;是&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;开&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;開&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
以下值始终返回 &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(&amp;#039;no&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;n&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;false&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;f&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;off&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;0&amp;#039;)&lt;br /&gt;
yesno(0)&lt;br /&gt;
yesno(false)&lt;br /&gt;
yesno(&amp;#039;否&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;关&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;關&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; 值始终返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(nil)&lt;br /&gt;
yesno()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
字符串在匹配前会转换为小写：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- 始终返回 true：&lt;br /&gt;
yesno(&amp;#039;Yes&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;YES&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;yEs&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;Y&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;tRuE&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;ON&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- 始终返回 false：&lt;br /&gt;
yesno(&amp;#039;No&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;NO&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;nO&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;N&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;fALsE&amp;#039;)&lt;br /&gt;
yesno(&amp;#039;OFF&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 未定义值 ===&lt;br /&gt;
如果 yesno 收到上面未列出的值，可指定默认值。不提供默认值时返回 &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- 以下返回 nil：&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;)&lt;br /&gt;
yesno({})&lt;br /&gt;
yesno(5)&lt;br /&gt;
yesno(function() return &amp;#039;这是函数&amp;#039; end)&lt;br /&gt;
&lt;br /&gt;
-- 以下返回 true：&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, true)&lt;br /&gt;
yesno({}, true)&lt;br /&gt;
yesno(5, true)&lt;br /&gt;
yesno(function() return &amp;#039;这是函数&amp;#039; end, true)&lt;br /&gt;
&lt;br /&gt;
-- 以下返回 &amp;quot;bar&amp;quot;：&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno({}, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno(5, &amp;#039;bar&amp;#039;)&lt;br /&gt;
yesno(function() return &amp;#039;这是函数&amp;#039; end, &amp;#039;bar&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
空白字符串同样按未定义处理：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(&amp;#039;&amp;#039;)        -- 返回 nil&lt;br /&gt;
yesno(&amp;#039;&amp;#039;, true)  -- 返回 true&lt;br /&gt;
yesno(&amp;#039;&amp;#039;, &amp;#039;bar&amp;#039;) -- 返回 &amp;quot;bar&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
尽管空字符串在 wikitext 中通常等价于 false，但 Lua 视其为非空字符串。本模块遵循 Lua 行为。如果需要将空字符串视为 false，请在传入前过滤，例如 [[Module:Arguments]] 默认会移除空白参数。&lt;br /&gt;
&lt;br /&gt;
=== 处理 nil ===&lt;br /&gt;
&lt;br /&gt;
根据定义：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
yesno(nil)         -- 返回 nil&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;)       -- 返回 nil&lt;br /&gt;
yesno(nil, true)   -- 返回 nil（nil 不走默认值）&lt;br /&gt;
yesno(nil, false)  -- 返回 nil&lt;br /&gt;
yesno(&amp;#039;foo&amp;#039;, true) -- 返回 true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
要获得纯粹的 &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; 二元值，推荐以下模式：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- 清晰写法：显式处理 nil&lt;br /&gt;
local result = yesno(value)&lt;br /&gt;
if result == nil then&lt;br /&gt;
    result = true  -- nil 时的回退值&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- 简洁写法：默认 false&lt;br /&gt;
result = yesno(value or false, false)&lt;br /&gt;
&lt;br /&gt;
-- 简洁写法：默认 true&lt;br /&gt;
result = yesno(value or true, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
[[Category:元模块]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiBot</name></author>
	</entry>
</feed>