1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Document escape_attrs :once

close #1051
This commit is contained in:
Takashi Kokubun 2021-02-19 17:04:49 -08:00
parent 5459fd31d1
commit 77ccce6105
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -107,13 +107,20 @@ output.
In Rails, options can be set by setting the {Haml::Template#options Haml::Template.options}
hash in an initializer:
# config/initializers/haml.rb
Haml::Template.options[:format] = :html5
```ruby
# config/initializers/haml.rb
Haml::Template.options[:format] = :html5
# Avoid escaping attributes which are already escaped
Haml::Template.options[:escape_attrs] = :once
```
Outside Rails, you can set them by configuring them globally in
Haml::Options.defaults:
Haml::Options.defaults[:format] = :html5
```ruby
Haml::Options.defaults[:format] = :html5
```
In sinatra specifically, you can set them in global config with:
```ruby