lib/faml/compiler.rb in faml-0.3.4 vs lib/faml/compiler.rb in faml-0.3.5
- old
+ new
@@ -317,18 +317,18 @@
static_attributes = {}
parser.static_attributes.each do |k, v|
static_attributes[k.to_s] = v
end
- class_list = Array(static_attributes['class']).flat_map { |c| c.to_s.split(/ +/) }
+ class_list = Array(static_attributes.delete('class')).select { |v| v }.flat_map { |c| c.to_s.split(/ +/) }
unless static_class.empty?
class_list.concat(static_class.split(/ +/))
end
unless class_list.empty?
static_attributes['class'] = class_list.uniq.sort.join(' ')
end
- id_list = Array(static_attributes['id'])
+ id_list = Array(static_attributes.delete('id')).select { |v| v }
unless static_id.empty?
id_list = [static_id].concat(id_list)
end
unless id_list.empty?
static_attributes['id'] = id_list.join('_')