Module:ParserFunctions

From CrawlWiki
Revision as of 22:47, 18 March 2015 by CommanderC (talk | contribs) (Created page with "local p = {} function p.If(frame) function notBlank(x) return not tostring(x):find("^%s*$") end if notBlank(frame.args[1]) then return frame.args[2] else ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Documentation for this module may be created at Module:ParserFunctions/doc

local p = {}

function p.If(frame)
  function notBlank(x)
    return not tostring(x):find("^%s*$")
  end
  if notBlank(frame.args[1]) then
    return frame.args[2]
  else
    return frame.args[3]
  end
end

return p