Official Tower Defense Simulator Wiki
Succumb to the dark sun! Like many before you.
2,699
articles

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

-- Don't question it
local p = {}

local function clean(s) -- https://en.wikipedia.org/wiki/Help:Strip_markers
	return s and s:gsub("\127[^\127]*\127", "")
end

local function extract(frame)
	local arg = frame.args[1] or frame:getParent().args[1]
	return clean(arg)
end

-- extract name
function p.tarukaja(frame)
	local r = extract(frame):match("^[^%-]*%-%s*(.-)%s*%-")
	if r and r ~= "" and not r:match("^[%s<]") then
		return r
	end
	return "''N/A''"
end

-- extract image
function p.heeho(frame)  return extract(frame):match("%[%[(.-)%s*[|%]]") end
-- extract cost
function p.macca(frame)  return extract(frame):match("%-%s*(.-)%s*$")    end
-- extract level
function p.gospel(frame) return extract(frame):match("^%s*(.-)%s*%-")    end

return p