Module: RTeX::Framework::Rails::HelperMethods

Defined in:
lib/rtex/framework/rails.rb

Instance Method Summary collapse

Instance Method Details

#latex_escape(*args) ⇒ Object Also known as: l

Similar to h()


58
59
60
61
62
63
64
65
66
67
# File 'lib/rtex/framework/rails.rb', line 58

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