查看“Module:Yesno”的源代码
因为以下原因,您没有权限编辑本页:
您可以查看和复制此页面的源代码。
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the
-- following line.
val = type(val) == 'string' and mw.ustring.lower(val) or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or val == 'on'
or val == '是'
or val == '开'
or val == '開'
or tonumber(val) == 1
000
1:0
本页使用的模板:
返回Module:Yesno。