Module:Utils: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 30: Line 30:
function p.value_provided(s)
function p.value_provided(s)
return type(s) == "string" and #s > 0
return type(s) == "string" and #s > 0
end
-- Return a link to Wikipedia in Wiki markup
function p.wlink(a, b, lang)
return string.format("[[wikipedia:%s%s|%s]]",
((p.trim(lang) == "" or lang == nil) and "" or lang),
a,
((p.trim(b) == "" or b == nil) and a or b)
)
end
end