diff --git a/vendor/plugins/action_cache/lib/action_cache.rb b/vendor/plugins/action_cache/lib/action_cache.rb index 16eace40..79544126 100644 --- a/vendor/plugins/action_cache/lib/action_cache.rb +++ b/vendor/plugins/action_cache/lib/action_cache.rb @@ -135,7 +135,7 @@ module ActionController controller.response.headers['Cache-Control'] == 'no-cache' controller.response.headers['Cache-Control'] = "max-age=#{controller.response.time_to_live}" end - controller.response.headers['Etag'] = %{"#{MD5.new(controller.response.body).to_s}"} + controller.response.headers['ETag'] = %{"#{MD5.new(controller.response.body).to_s}"} controller.response.headers['Last-Modified'] ||= Time.now.httpdate end @@ -148,13 +148,13 @@ module ActionController def send_not_modified(controller) controller.logger.info "Send Not Modified" - controller.response.headers['Etag'] = %{"#{MD5.new(fragment_body(controller)).to_s}"} + controller.response.headers['ETag'] = %{"#{MD5.new(fragment_body(controller)).to_s}"} controller.render(:text => "", :status => 304) end def client_has_latest?(cache_entry, controller) requestEtag = controller.request.env['HTTP_IF_NONE_MATCH'] rescue nil - responseEtag = cache_entry.headers['Etag'] rescue nil + responseEtag = cache_entry.headers['ETag'] rescue nil return true if (requestEtag and responseEtag and requestEtag == responseEtag) requestTime = Time.rfc2822(controller.request.env["HTTP_IF_MODIFIED_SINCE"]) rescue nil responseTime = Time.rfc2822(cache_entry.headers['Last-Modified']) rescue nil diff --git a/vendor/plugins/maruku/lib/maruku/ext/math/latex_fix.rb b/vendor/plugins/maruku/lib/maruku/ext/math/latex_fix.rb new file mode 100644 index 00000000..6ce588d6 --- /dev/null +++ b/vendor/plugins/maruku/lib/maruku/ext/math/latex_fix.rb @@ -0,0 +1,12 @@ +class String + + # fix some LaTeX command-name clashes + def fix_latex + if #{html_math_engine} == 'itex2mml' + s = self.gsub("\\mathop{", "\\operatorname{") + s.gsub("\\space{", "\\itexspace{") + else + self + end + end +end diff --git a/vendor/plugins/maruku/lib/maruku/ext/math/to_latex.rb b/vendor/plugins/maruku/lib/maruku/ext/math/to_latex.rb index 578eb713..fb925bc1 100644 --- a/vendor/plugins/maruku/lib/maruku/ext/math/to_latex.rb +++ b/vendor/plugins/maruku/lib/maruku/ext/math/to_latex.rb @@ -1,16 +1,17 @@ - module MaRuKu; module Out; module Latex +require 'maruku/ext/math/latex_fix' + def to_latex_inline_math - "$#{self.math.strip}$" + s = "$#{self.math.strip}$".fix_latex end def to_latex_equation if self.label l = "\\label{#{self.label}}" - "\\begin{equation}\n#{self.math.strip}\n#{l}\\end{equation}\n" + "\\begin{equation}\n#{self.math.strip}\n#{l}\\end{equation}\n".fix_latex else - "\\begin{displaymath}\n#{self.math.strip}\n\\end{displaymath}\n" + "\\begin{displaymath}\n#{self.math.strip}\n\\end{displaymath}\n".fix_latex end end @@ -18,4 +19,4 @@ module MaRuKu; module Out; module Latex "\\eqref{#{self.eqid}}" end -end end end \ No newline at end of file +end end end