-- Function allowing for consistent treatment of boolean-like wikitext input.-- It works similarly to the template .
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)
nil then return nil elseif val
'yes' or val
'true' or val
'on' or tonumber(val)
false or val
'n' or val
'f' or val
0 then return false else return default endend