lib/lookbook/utils.rb in lookbook-0.8.3 vs lib/lookbook/utils.rb in lookbook-0.9.0
- old
+ new
@@ -4,10 +4,10 @@
FRONTMATTER_REGEX = /\A---(.|\n)*?---/
protected
def generate_id(*args)
- parts = args.map { |arg| arg.to_s.parameterize.underscore }
+ parts = args.map { |arg| arg.to_s.force_encoding("UTF-8").parameterize.underscore }
parts.join("-").tr("/", "-").tr("_", "-").delete_prefix("-").delete_suffix("-").gsub("--", "-")
end
def preview_class_basename(klass)
class_name(klass).to_s.chomp("ComponentPreview").chomp("Component::Preview").chomp("::Preview").chomp("Component").chomp("::")