Skip to content

Commit

Permalink
fix function Yesno(value, default_value)
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Nov 18, 2024
1 parent 138c8ab commit 2df7f8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/net/wiki/parser/evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2000,9 +2000,9 @@ function module_code(library_namespace) {
if (value === undefined)
return;
value = String(value).replace(/<!--[\s\S]*?-->/g, '').trim();
if (/^(?:[nf]|no|false|off)$/i.test(value))
if (/^(?:[0nf]|no|false|off)$/i.test(value))
return false;
if (/^(?:[yt]|yes|true|on)$/i.test(value))
if (/^(?:[1yt]|yes|true|on)$/i.test(value))
return true;
// 須注意有特別的元素時可能回傳整個字串!
return default_value === undefined ? value : default_value;
Expand Down

0 comments on commit 2df7f8b

Please sign in to comment.