642
回編集
template>ネイ (en:Module:Check for unknown parameters oldid=881505995 より更新) |
Triple-Zeta (トーク | 投稿記録) 細 (12版 をインポートしました) |
||
(他の1人の利用者による、間の2版が非表示) | |||
35行目: | 35行目: | ||
end | end | ||
function p. | function p._check(args, pargs) | ||
if type(args) ~= "table" or type(pargs) ~= "table" then | |||
-- TODO: error handling | |||
return | |||
end | |||
local ignoreblank = isnotempty(args['ignoreblank']) | local ignoreblank = isnotempty(args['ignoreblank']) | ||
local showblankpos = isnotempty(args['showblankpositional']) | local showblankpos = isnotempty(args['showblankpositional']) | ||
58行目: | 60行目: | ||
end | end | ||
if isnotempty(preview) then | if isnotempty(preview) then | ||
preview = '<div class="hatnote" style="color:red"><strong>警告:</strong> ' .. preview .. ' | preview = '<div class="hatnote" style="color:red"><strong>警告:</strong> ' .. preview .. '(このメッセージはプレビュー時のみ表示されます。)</div>' | ||
elseif preview == nil then | elseif preview == nil then | ||
preview = unknown | preview = unknown | ||
86行目: | 88行目: | ||
-- add results to the output tables | -- add results to the output tables | ||
if #values > 0 then | if #values > 0 then | ||
if | if mw.getCurrentFrame():preprocess( "{{REVISIONID}}" ) == "" then | ||
unknown = preview | unknown = preview | ||
end | end | ||
102行目: | 104行目: | ||
return table.concat(res) | return table.concat(res) | ||
end | |||
function p.check(frame) | |||
local args = frame.args | |||
local pargs = frame:getParent().args | |||
return p._check(args, pargs) | |||
end | end | ||
return p | return p |