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:
ChaYoung You 2015-03-05 18:19:32 +09:00
parent 117bd8a6f0
commit 489da6784a
1 changed files with 1 additions and 1 deletions

View File

@ -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