mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 01:08:26 -05:00
Remove duplicated range from regex
`/\w/` is equivalent to `[a-zA-Z0-9_]`. See http://ruby-doc.org/core-2.2.0/doc/regexp_rdoc.html#label-Character+Classes.
This commit is contained in:
@@ -528,7 +528,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def sanitize_filename(name)
|
||||
name.gsub!(/[^\w\s_-]+/, '')
|
||||
name.gsub!(/[^\w\s-]+/, '')
|
||||
name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2')
|
||||
name.gsub(/\s+/, '_')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user