Module:Infobox/split: Difference between revisions

From Nguhcraft Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
end
end
p.makeEmptyColumnEmpty = function(frame)
p.makeEmptyColumnEmpty = function(frame)
if string.find(frame.args[1], "^<span%s*/>$") == nil then --"^(%s*<span%s*/>%s*)*$"
if string.find(frame.args[1], "^%s*<span%s*/>%s*$") == nil then --"^(%s*<span%s*/>%s*)*$"
return frame.args[1]
return frame.args[1]
end
end

Revision as of 16:05, 23 October 2024

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

local p = {}
p.generateColumns = function(frame)
	local ret = ""
	for i in frame.args do
		ret = ret .. frame:expandTemplate{ title = "User:Viklo/Infobox/split/column", args = { i } }
	end
	return ret
end
p.makeEmptyColumnEmpty = function(frame)
	if string.find(frame.args[1], "^%s*<span%s*/>%s*$") == nil then --"^(%s*<span%s*/>%s*)*$"
		return frame.args[1]
	end
	return ""
end
return p