dnagir / ruby-haml-js

HAML-JS Tile and Rails 3.1 Template
MIT License
86 stars 13 forks source link

Configure custom escape option #3

Closed shiftb closed 12 years ago

shiftb commented 12 years ago

Is there a way yet to configure the custom escape option that haml-js has? Right now it's including the default html_escape in every template which isn't optimal.

Thanks for the great library!

dnagir commented 12 years ago

It is planned. But I will get my hands onto it next week or so.

How would you like to provide the options? I thought about something like:

RubyHamlJs::Template.custom_escape = "App.escape_html"

But not sure if that's the best way.

dnagir commented 12 years ago

Or you can submit a pull request. Take this as a baseline: https://github.com/dnagir/pakunok/blob/master/lib/pakunok/haml_js_template.rb#L52

and make sure to write the specs.

shiftb commented 12 years ago

Thanks so much!!