Unfortunately, you can't turn this on with an option to
Erubis::Eruby.new -- you need to use the Erubis::EscapedEruby
subclass.
One could always create a Tilt::EscapedErubisTemplate to achieve this,
but might be nicer if we could pass in an option to
Tilt::ErubisTemplate which would allow you to specify the engine class
to use, something like:
Tilt::ErubisTemplate.new 'foo.erb', 1, :engine_class =>
"::Erubis::EscapedEruby"
Any interest in a patch for this?
Definitely.
I like reserving the options Hash for the underlying engine but this
seems like a reasonable place to break that rule.
:engine_class would work and allow people to write custom subclasses,
which would be another Erubis feature we can't use today. It might be
nice to also have a simpler :escaping => true option too.
Thanks,
Ryan
Re: :escaping => true, this would be a nice convenience for the most
common case. Haml calls this option :escape_html; probably makes sense
to use this as the convention and have it work for both Haml and
Erubis?
On Mar 8, 3:42 pm, Ryan Tomayko <rtoma...@gmail.com> wrote:
Yep. That's perfect.
Thanks,
Ryan
http://github.com/gbuesing/tilt/commit/c9bc18ad52a7ba280acaed343647147806fc3e7b
(I just sent a pull request as well.)
On Mar 8, 5:03 pm, Ryan Tomayko <rtoma...@gmail.com> wrote:
Looks great. Applied.
Thanks,
Ryan