Module:If empty: Difference between revisions

From Mirrorplay: Fae
Jump to navigation Jump to search
mpfae>MSGJ
(lastk is not needed)
 
m (1 revision imported: Module Data from Wikipedia)
 
(No difference)

Latest revision as of 09:05, 16 June 2024

{{#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