# Haml Changelog * Table of contents {:toc} ## 2.4.0 (Unreleased) ### `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. * 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`. ### More Powerful `:autoclose` Option The {file:HAML_REFERENCE.md#attributes_option `:attributes`} option can now take regular expressions that specify which tags to make self-closing. ### `--double-quote-attributes` Option The Haml executable now has a `--double-quote-attributes` option (short form: `-q`) that causes attributes to use a double-quote mark rather than single-quote. ### `haml-spec` Integration We've added the cross-implementation tests from the [haml-spec](http://github.com/norman/haml-spec) project to the standard Haml test suite, to be sure we remain compatible with the base functionality of the many and varied [Haml implementations](http://en.wikipedia.org/wiki/Haml#Implementations). ### Ruby 1.9 Support * Haml and `html2haml` now produce more descriptive errors when given a template with invalid byte sequences for that template's encoding, including the line number and the offending character. * Haml and `html2haml` now accept Unicode documents with a [byte-order-mark](http://en.wikipedia.org/wiki/Byte_order_mark). ### `:css` Filter Haml now supports a {file:HAML_REFERENCE.md#css-filter `:css` filter} that surrounds the filtered text with `