lib/lookbook/utils.rb in lookbook-1.0.0.beta.0 vs lib/lookbook/utils.rb in lookbook-1.0.0.beta.1
- old
+ new
@@ -6,10 +6,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("/_", "-").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("Preview").chomp("::")