Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG.md
	Rakefile
	lib/haml/version.rb
  • Loading branch information
norman committed Apr 5, 2013
2 parents 3766c39 + fb0c832 commit a2bad49
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ gemfile:
- test/gemfiles/Gemfile.rails-4.0.x
matrix:
exclude:
# Don't kill Travis: just test against the latest version on Head, JRuby and rbx.
# Don't kill Travis: just test against the latest version on 2.0, JRuby
# and Rubinius.
- { rvm: jruby, gemfile: test/gemfiles/Gemfile.rails-3.0.x }
- { rvm: jruby, gemfile: test/gemfiles/Gemfile.rails-3.1.x }
- { rvm: jruby, gemfile: test/gemfiles/Gemfile.rails-3.2.x }
Expand All @@ -29,6 +30,7 @@ matrix:

allow_failures:
- { rvm: jruby, gemfile: test/gemfiles/Gemfile.rails-4.0.x }
- { rvm: rbx-19mode, gemfile: test/gemfiles/Gemfile.rails-4.0.x }

branches:
only:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
* Make escape_once respect hexadecimal references. (Matt Wildig)
* General performance and memory usage improvements. (Akira Matsuda)

## 4.0.2

Released April 5, 2013 ([diff](https://github.com/haml/haml/compare/4.0.1...4.0.2)).

* Explicitly require Erubis to work around bug in older versions of Tilt.
* Fix :erb filter printing duplicate content in Rails views.
(thanks [Jori Hardman](https://github.com/jorihardman))
* Replace range with slice to reduce objects created by `capture_haml`.
(thanks [Tieg Zaharia](https://github.com/tiegz))
* Correct/improve some documentation.

## 4.0.1

Released March 21, 2013 ([diff](https://github.com/haml/haml/compare/4.0.0...4.0.1)).
Expand Down
27 changes: 14 additions & 13 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,31 +491,32 @@ and is compiled to:
</div>
</div>

### Self-Closing Tags: `/`
### Empty (void) Tags: `/`

The forward slash character, when placed at the end of a tag definition, causes
the tag to be self-closed. For example:
Haml to treat it as being an empty (or void) element. Depending on the format,
the tag will be rendered either without a closing tag (`:html4` or `:html5`), or
as a self-closing tag (`:xhtml`). For example:

%br/
%meta{'http-equiv' => 'Content-Type', :content => 'text/html'}/

is compiled to:

<br />
<meta http-equiv='Content-Type' content='text/html' />
<br>
<meta content='text/html' http-equiv='Content-Type'>

Some tags are automatically closed, as long as they have no content. `meta`,
`img`, `link`, `script`, `br`, and `hr` tags are closed by default. This list
can be customized by setting the [`:autoclose`](#autoclose-option) option. For
example:
when the format is `:html4` or `:html5`, and to

%br
%meta{'http-equiv' => 'Content-Type', :content => 'text/html'}
<br />
<meta content='text/html' http-equiv='Content-Type' />

is also compiled to:
when the format is `:xhtml`.

<br />
<meta http-equiv='Content-Type' content='text/html' />
Some tags are automatically treated as being empty, as long as they have no
content in the Haml source. `meta`, `img`, `link`, `script`, `br`, and `hr` tags
are treated as empty by default. This list can be customized by setting the
{Haml::Options#autoclose `:autoclose`} option.

### Whitespace Removal: `>` and `<`

Expand Down
2 changes: 2 additions & 0 deletions lib/haml/filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ def compile(compiler, text)
module Erb
class << self
def precompiled(text)
#workaround for https://github.com/rtomayko/tilt/pull/183
require 'erubis' if (defined?(::Erubis) && !defined?(::Erubis::Eruby))
super.sub(/^#coding:.*?\n/, '')
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/haml/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def capture_haml(*args, &block)
end

captured.map do |line|
line[min_tabs..-1]
line.slice(min_tabs, line.length)
end.join
end
ensure
Expand Down
2 changes: 1 addition & 1 deletion lib/haml/helpers/safe_erubis_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def prepare
end

def precompiled_preamble(locals)
[super, "@output_buffer = output_buffer ||= nil || ActionView::OutputBuffer.new;"]
[super, "@output_buffer = ActionView::OutputBuffer.new;"]
end

def precompiled_postamble(locals)
Expand Down

0 comments on commit a2bad49

Please sign in to comment.