Module:Yesno: திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
get arguments from the parent frame if the current frame doesn't have any |
tweak logic to make it work like the actual template - the documentation was slightly wrong |
||
வரிசை 1:
local p = {}
function p.yesno(frame)
-- defaults
local retvals = {
வரிசை 9:
["¬"] = ""
}
-- Allow arguments to override defaults.
-- 'any' tracks the presence of any arguments at all.
வரிசை 27:
end
end
val = args[1]
--
▲ if (val == nil and not any) or val == '¬' then
return retvals['¬']
end
val =
val = val:match'^%s*(.*%S)' or '' -- Trim whitespace.
if val == '' then
return
elseif val == 'n' or val == 'no' or val == '0' then
return retvals['no']
வரி 50 ⟶ 48:
end
end
return p
| |||