Module:If empty

From Mirrorplay: Fae
Revision as of 09:05, 16 June 2024 by Storyteller (talk | contribs) (1 revision imported: Module Data from Wikipedia)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{{#ifeq:If empty|doc|{{#if:|}}|{{#switch:

 {{#if:
 |     
 | {{#ifeq:Module|Module
   | module
   | other
   }}
 }}
| module = {{#ifeq: If empty | Sandbox
    | 
    | {{#switch: If empty
        | doc | sandbox =
        | {{#ifeq:  | true 
            |  
            | {{#switch: protected
                | pre-alpha | prealpha | pa =
                | alpha | a =
                | beta | b =
                | release | r | general | g =
                | protected | protect | p =
                | semiprotected | semiprotect | semi =
              }}
          }}
      }}
   }}

| other | #default = Error: {{Module rating}} must be placed in the Module namespace. }}}}

This module supports Template:If empty. See here for test cases.

{{#ifeq:If empty|sandbox | | }}


local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})

	for k,v in ipairs(args) do
		if v ~= '' then
			return v
		end
	end

end

return p