haml-edge 3.1.68 → 3.1.69

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.68
1
+ 3.1.69
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.68
1
+ 3.1.69
@@ -534,8 +534,8 @@ END
534
534
  result = attributes.collect do |attr, value|
535
535
  next if value.nil?
536
536
 
537
- value = filter_and_join(value, ' ') if attr == :class
538
- value = filter_and_join(value, '_') if attr == :id
537
+ value = filter_and_join(value, ' ') if attr == 'class'
538
+ value = filter_and_join(value, '_') if attr == 'id'
539
539
 
540
540
  if value == true
541
541
  next " #{attr}" if is_html
@@ -561,8 +561,10 @@ END
561
561
  end
562
562
 
563
563
  def self.filter_and_join(value, separator)
564
+ return "" if value == ""
564
565
  value = [value] unless value.is_a?(Array)
565
- return value.flatten.collect {|item| item ? item.to_s : nil}.compact.join(separator)
566
+ value = value.flatten.collect {|item| item ? item.to_s : nil}.compact.join(separator)
567
+ return !value.empty? && value
566
568
  end
567
569
 
568
570
  def prerender_tag(name, self_close, attributes)
@@ -148,7 +148,7 @@ MESSAGE
148
148
  assert_equal("<p class='b css'>foo</p>\n", render("%p.css{:class => %w[css b]} foo")) # merge uniquely
149
149
  assert_equal("<p class='a b c d'>foo</p>\n", render("%p{:class => [%w[a b], %w[c d]]} foo")) # flatten
150
150
  assert_equal("<p class='a b'>foo</p>\n", render("%p{:class => [:a, :b] } foo")) # stringify
151
- assert_equal("<p class=''>foo</p>\n", render("%p{:class => [nil, false] } foo")) # strip falsey
151
+ assert_equal("<p>foo</p>\n", render("%p{:class => [nil, false] } foo")) # strip falsey
152
152
  assert_equal("<p class='a'>foo</p>\n", render("%p{:class => :a} foo")) # single stringify
153
153
  assert_equal("<p>foo</p>\n", render("%p{:class => false} foo")) # single falsey
154
154
  assert_equal("<p class='a b html'>foo</p>\n", render("%p(class='html'){:class => %w[a b]} foo")) # html attrs
@@ -159,7 +159,7 @@ MESSAGE
159
159
  assert_equal("<p id='css_a_b'>foo</p>\n", render("%p#css{:id => %w[a b]} foo")) # merge with css
160
160
  assert_equal("<p id='a_b_c_d'>foo</p>\n", render("%p{:id => [%w[a b], %w[c d]]} foo")) # flatten
161
161
  assert_equal("<p id='a_b'>foo</p>\n", render("%p{:id => [:a, :b] } foo")) # stringify
162
- assert_equal("<p id=''>foo</p>\n", render("%p{:id => [nil, false] } foo")) # strip falsey
162
+ assert_equal("<p>foo</p>\n", render("%p{:id => [nil, false] } foo")) # strip falsey
163
163
  assert_equal("<p id='a'>foo</p>\n", render("%p{:id => :a} foo")) # single stringify
164
164
  assert_equal("<p>foo</p>\n", render("%p{:id => false} foo")) # single falsey
165
165
  assert_equal("<p id='html_a_b'>foo</p>\n", render("%p(id='html'){:id => %w[a b]} foo")) # html attrs
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.68
4
+ version: 3.1.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum