diff --git a/app/metal/itex.rb b/app/metal/itex.rb
index 7e27ca3a..3d9e4121 100644
--- a/app/metal/itex.rb
+++ b/app/metal/itex.rb
@@ -1,4 +1,4 @@
-# Allow the metal piece to run in isolation
+ # Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
require 'stringsupport'
@@ -16,9 +16,17 @@ class Itex
def self.response(env)
@params = Rack::Request.new(env).params
- tex = @params['tex'].purify
- display = @params['display'] || 'inline'
- filter = (display + '_filter').to_sym
+ tex = (@params['tex'] || '').purify
+ case @params['display']
+ when 'block'
+ filter = :block_filter
+ when 'inline'
+ filter = :inline_filter
+ else
+ filter = :inline_filter
+ end
+ return "" if tex.strip == ''
estart = ""
begin