diff --git a/lib/haml/attribute_builder.rb b/lib/haml/attribute_builder.rb index d50e8467f..fb3271e09 100644 --- a/lib/haml/attribute_builder.rb +++ b/lib/haml/attribute_builder.rb @@ -105,7 +105,7 @@ def flatten_attributes(attributes) if k.nil? flattened[key] = v else - flattened["#{key}-#{k.to_s.gsub(/_/, '-')}"] = v + flattened["#{key}-#{k.to_s.tr('_', '-')}"] = v end end else