Módulo:Zona de pruebas/Funez Remiaw/02

Este módulo no tiene página de documentación[crear]
-- PROTOTIPO DE PROCESADOR DE ENTRADAS PARA IMÁGENES PARA INFOBOXES

local x = {}

function x.image(frame)
	local p = frame.args[1]
-- Retirando "[[File:"
	if string.match(p, "File:") then
		p = string.sub(p, 8) 
	end
-- Retirando "]]" y atributos posteriores
	if string.match(p, "|thumb", -9) or string.match(p, "|(%d)(%d)(%d)px", -8) then
		return string.sub(p, 1, -9)
	elseif string.match(p, "|(%d)(%d)px", -7) then
		return string.sub(p, 1, -8)
	elseif string.match(p, "]]", -2) then
		return string.sub(p, 1, -3)
	else
		return p
	end
	return p
end

return x