Module:Clean image

-- Removes 'File:' prefix, just in case -- Replace | with | instead of preprocessing -- Turn into a nice wiki file link local p = {} p.main = function(frame) local args = frame:getParent.args local clean = { file = args.file or args[1], width = args.width or args[2], height = args.height or args[3] }	return p.clean(clean) end

p.clean = function(args) local file = args.file if not file or (file and (file:lower == 'no' or file == '')) then return '' end local height, width = , if args.height then height = 'x'..args.height end if args.width then width = args.width end local size = string.format('|%s%spx', width, height) file = file:gsub('%[',):gsub('%]',):gsub('[Ff]ile:',''):gsub('|','|')

-- enforce max height and width file = mw.text.split(file, '|')

file = string.format('%s%s',file[1], size) return '' end

return p