<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -55,8 +55,15 @@ module RTeX
       
       module HelperMethods
         # Similar to h()
-        def latex_escape(s)
-          RTeX::Document.escape(s)
+        def latex_escape(*args)
+          # Since Rails' I18n implementation aliases l() to localize(), LaTeX
+          # escaping should only be done if RTeX is doing the rendering.
+          # Otherwise, control should be be passed to localize().
+          if Thread.current[:_rendering_rtex]
+            RTeX::Document.escape(*args)
+          else
+            localize(*args)
+          end
         end
         alias :l :latex_escape
       end</diff>
      <filename>lib/rtex/framework/rails.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9faca892d7edf55657a61fab85a7b1f0a5e0431c</id>
    </parent>
  </parents>
  <author>
    <name>David Cato</name>
    <email>git@crunchyfrog.net</email>
  </author>
  <url>http://github.com/bruce/rtex/commit/a694e0afa4c57347a48ad09d6e845ba2c589e8f0</url>
  <id>a694e0afa4c57347a48ad09d6e845ba2c589e8f0</id>
  <committed-date>2009-04-13T23:33:56-07:00</committed-date>
  <authored-date>2009-04-07T10:48:39-07:00</authored-date>
  <message>Allow latex_escape to work in a Rails 2.2+ environment

Since Rails 2.2 aliases l() as localize(), this leads to conflicts with
RTeX's aliasing of l() as latex_escape(). To work around the conflict,
this patch forces latex_escape to pass control on to localize if rtex is
not doing the rendering.

Signed-off-by: Bruce Williams &lt;bruce@codefluency.com&gt;</message>
  <tree>22babfcf23e11f814f85d5ee82c617e9c7406a4e</tree>
  <committer>
    <name>Bruce Williams</name>
    <email>bruce@codefluency.com</email>
  </committer>
</commit>
