Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/slug/slug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ def validate_slug_columns
# Feel free to override this method if you'd like different slug formatting.
def normalize_slug(str)
return if str.blank?
str.gsub!(/[\p{Pc}\p{Ps}\p{Pe}\p{Pi}\p{Pf}\p{Po}]/, '') # Remove punctuation
str.parameterize
# Remove punctuation
str
.gsub(/[\p{Pc}\p{Ps}\p{Pe}\p{Pi}\p{Pf}\p{Po}]/, '')
.parameterize
end

# If a slug of the same name already exists, this will append '-n' to the end of the slug to
Expand Down