[Haml] Default to :html5 under Rails 3.

This commit is contained in:
Nathan Weizenbaum 2010-05-30 17:32:35 -07:00
parent 67efe15366
commit eac7a5f369
3 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,12 @@ Rather than defaulting to `"utf-8"`,
it defaults to the encoding of the source document,
and only falls back to `"utf-8"` if this encoding is `"us-ascii"`.
### Other Changes
* Default to the {file:HAML_REFERENCE.md#format-option `:html5` format}
when running under Rails 3,
since it defaults to HTML5 as well.
## 3.0.6
[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.6).

View File

@ -46,6 +46,10 @@ unless Haml::Util.rails_env == "development"
Haml::Template.options[:ugly] ||= true
end
if ActionPack::VERSION::MAJOR >= 3
Haml::Template.options[:format] ||= :html5
end
# Decide how we want to load Haml into Rails.
# Patching was necessary for versions <= 2.0.1,
# but we can make it a normal handler for higher versions.

View File

@ -9,6 +9,7 @@ require 'sass'
require 'haml/template'
Haml::Template.options[:ugly] = false
Haml::Template.options[:format] = :xhtml
Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)