Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
cf0668eb53
|
@ -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(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
|
||||||
|
|
||||||
require 'stringsupport'
|
require 'stringsupport'
|
||||||
|
@ -16,9 +16,17 @@ class Itex
|
||||||
|
|
||||||
def self.response(env)
|
def self.response(env)
|
||||||
@params = Rack::Request.new(env).params
|
@params = Rack::Request.new(env).params
|
||||||
tex = @params['tex'].purify
|
tex = (@params['tex'] || '').purify
|
||||||
display = @params['display'] || 'inline'
|
case @params['display']
|
||||||
filter = (display + '_filter').to_sym
|
when 'block'
|
||||||
|
filter = :block_filter
|
||||||
|
when 'inline'
|
||||||
|
filter = :inline_filter
|
||||||
|
else
|
||||||
|
filter = :inline_filter
|
||||||
|
end
|
||||||
|
return "<math xmlns='http://www.w3.org/1998/Math/MathML' display='" +
|
||||||
|
filter.to_s[/(.*?)_filter/] + "'/>" if tex.strip == ''
|
||||||
estart = "<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><merror><mtext>"
|
estart = "<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><merror><mtext>"
|
||||||
eend = "</mtext></merror></math>"
|
eend = "</mtext></merror></math>"
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Reference in a new issue