# Haml Changelog * Table of contents {:toc} ## 3.0.23 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.23). * Fix the error message for unloadable modules when running the executables under Ruby 1.9.2. * Fix an error when combining old-style and new-style attributes. ## 3.0.22 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.22). * Allow an empty line after `case` but before `when`. * Remove `vendor/sass`, which snuck into the gem by mistake and was causing trouble for Heroku users (thanks to [Jacques Crocker](http://railsjedi.com/)). * Support the Rails 3.1 template handler API. ## 3.0.21 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.21). * Fix the permissions errors for good. ## 3.0.20 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.20). * Fix some permissions errors. ## 3.0.19 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.19). * Fix the `:encoding` option under Ruby 1.9.2. * Fix interpolated if statement when HTML escaping is enabled. * Allow the `--unix-newlines` flag to work on Unix, where it's a no-op. ## 3.0.18 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18). * Don't require `rake` in the gemspec, for bundler compatibility under JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog). * Get rid of the annoying RDoc errors on install. * Disambiguate references to the `Rails` module when `haml-rails` is installed. * Fix a bug in `haml_tag` that would allow duplicate attributes to be added and make `data-` attributes not work. * Compatibility with Rails 3 final. ## 3.0.17 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17). * Understand that mingw counts as Windows. ## 3.0.16 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16). * Fix an html2haml ERB-parsing bug where ERB blocks were occasionally left without indentation in Haml. * Fix parsing of `if` and `case` statements whose values were assigned to variables. This is still bad style, though. * Fix `form_for` and `form_tag` when they're passed a block that returns a string in a helper. ## 3.0.15 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15). There were no changes made to Haml between versions 3.0.14 and 3.0.15. ## 3.0.14 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14). * Allow CSS-style classes and ids to contain colons. * Fix an obscure bug with if statements. ### Rails 3 Support * Don't use the `#returning` method, which Rails 3 no longer provides. ## 3.0.13 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13). ## Rails 3 Support Support for Rails 3 versions prior to beta 4 has been removed. Upgrade to Rails 3.0.0.beta4 if you haven't already. ### Minor Improvements * Properly process frozen strings with encoding declarations. ## 3.0.12 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12). ## Rails 3 Support Apparently the last version broke in new and exciting ways under Rails 3, due to the inconsistent load order caused by certain combinations of gems. 3.0.12 hacks around that inconsistency, and *should* be fully Rails 3-compatible. ### Deprecated: Rails 3 Beta 3 Haml's support for Rails 3.0.0.beta.3 has been deprecated. Haml 3.0.13 will only support 3.0.0.beta.4. ## 3.0.11 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.11). ## 3.0.10 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.10). ### Appengine-JRuby Support The way we determine the location of the Haml installation no longer breaks the version of JRuby used by [`appengine-jruby`](http://code.google.com/p/appengine-jruby/). ### Bug Fixes * Single-line comments are now handled properly by `html2haml`. ## 3.0.9 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.9). There were no changes made to Haml between versions 3.0.8 and 3.0.9. A bug in Gemcutter caused the gem to be uploaded improperly. ## 3.0.8 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.8). * Fix a bug with Rails versions prior to Rails 3. ## 3.0.7 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.7). ### Encoding Support Haml 3.0.7 adds support for Ruby-style `-# coding:` comments for declaring the encoding of a template. For details see {file:HAML_REFERENCE.md#encodings the reference}. This also slightly changes the behavior of Haml when the {file:HAML_REFERENCE.md#encoding-option `:encoding` option} is not set. 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"`. The `haml` executable also now takes an `-E` option for specifying encoding, which works the same way as Ruby's `-E` option. ### 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. ### Bug Fixes * When generating Haml for something like `foo,`, use `= succeed` rather than `- succeed` (which doesn't work). ## 3.0.6 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.6). ### Rails 2.3.7 Support This release fully supports Rails 2.3.7. ### Rails 2.3.6 Support Removed Rails 2.3.6 was released with various bugs related to XSS-protection and interfacing with Haml. Rails 2.3.7 was released shortly after with fixes for these bugs. Thus, Haml no longer supports Rails 2.3.6, and anyone using it should upgrade to 2.3.7. Attempting to use Haml with Rails 2.3.6 will cause an error. ## 3.0.5 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.5). ### Rails 2.3.6 Support This release hacks around various bugs in Rails 2.3.6, bringing Haml up to full compatibility. ### Rails 3 Support Make sure the `#capture` helper in Rails 3 doesn't print its value directly to the template. ## 3.0.4 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.4). There were no changes made to Haml between versions 3.0.3 and 3.0.4. ## 3.0.3 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.3). ### Rails 3 Support In order to make some Rails loading errors easier to debug, Sass will now raise an error if `Rails.root` is `nil` when Sass is loading. Previously, this would just cause the paths to be mis-set. ## 3.0.2 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.2). There were no changes made to Haml between versions 3.0.1 and 3.0.2. ## 3.0.1 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.1). ### Installation in Rails `haml --rails` is no longer necessary for installing Haml in Rails. Now all you need to do is add `gem "haml"` to the Gemfile for Rails 3, or add `config.gem "haml"` to `config/environment.rb` for previous versions. `haml --rails` will still work, but it has been deprecated and will print an error message. It will not work in the next version of Haml. ### Rails Test Speed The {file:HAML_REFERENCE.md#ugly-option `:ugly` option} is now on by default in the testing environment in Rails to help tests run faster. ## 3.0.0 {#3-0-0} [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.0). ### Backwards Incompatibilities: Must Read! * The `puts` helper has been removed. Use {Haml::Helpers#haml\_concat} instead. ### More Useful Multiline Ruby code can now be wrapped across multiple lines as long as each line but the last ends in a comma. For example: = link_to_remote "Add to cart", :url => { :action => "add", :id => product.id }, :update => { :success => "cart", :failure => "error" } ### `haml_tag` and `haml_concat` Improvements #### `haml_tag` with CSS Selectors The {Haml::Helpers#haml_tag haml\_tag} helper can now take a string using the same class/id shorthand as in standard Haml code. Manually-specified class and id attributes are merged, again as in standard Haml code. For example: haml_tag('#foo') #=>
haml_tag('.bar') #=> haml_tag('span#foo.bar') #=> haml_tag('span#foo.bar', :class => 'abc') #=> haml_tag('span#foo.bar', :id => 'abc') #=> Cheers, [S. Burkhard](http://github.com/hasclass/). #### `haml_tag` with Multiple Lines of Content The {Haml::Helpers#haml_tag haml\_tag} helper also does a better job of formatting tags with multiple lines of content. If a tag has multiple levels of content, that content is indented beneath the tag. For example: haml_tag(:p, "foo\nbar") #=> ## foo # bar #
#### `haml_tag` with Multiple Lines of Content Similarly, the {Haml::Helpers#haml_concat haml\_concat} helper will properly indent multiple lines of content. For example: haml_tag(:p) {haml_concat "foo\nbar"} #=> ## foo # bar #
#### `haml_tag` and `haml_concat` with `:ugly` When the {file:HAML_REFERENCE.md#ugly-option `:ugly` option} is enabled, {Haml::Helpers#haml_tag haml\_tag} and {Haml::Helpers#haml_concat haml\_concat} won't do any indentation of their arguments. ### Basic Tag Improvements * It's now possible to customize the name used for {file:HAML_REFERENCE.md#object_reference_ object reference} for a given object by implementing the `haml_object_ref` method on that object. This method should return a string that will be used in place of the class name of the object in the generated class and id. Thanks to [Tim Carey-Smith](http://twitter.com/halorgium). * All attribute values may be non-String types. Their `#to_s` method will be called to convert them to strings. Previously, this only worked for attributes other than `class`. ### `:class` and `:id` Attributes Accept Ruby Arrays In an attribute hash, the `:class` attribute now accepts an Array whose elements will be converted to strings and joined with