FANDOM


local p = {}
 
function p.main( frame )
	local tArgs = frame:getParent()
 
	if not(tArgs.args[1]) then
		tArgs = frame
	end
 
	local sText = tArgs.args[1]
	local sCompareTo = tArgs.args[2]
	local sTrueAction = tArgs.args[3] or tArgs.args["true"]
	local sFalseAction = tArgs.args[4] or tArgs.args["false"]
 
	if sText == sCompareTo then
		sText = mw.getCurrentFrame():preprocess(sTrueAction)
	else
		sText = mw.getCurrentFrame():preprocess(sFalseAction)
	end
 
	return sText
end
 
return p