diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 881e44b1..72c26741 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -124,7 +124,7 @@ module Jekyll :template => @collection.url_template, :placeholders => placeholders, }) - end.to_s.gsub /\/$/, '' + end.to_s.gsub(/\/$/, '') end # Returns the type of the collection if present, nil otherwise. diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index 367872c0..950945a7 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -92,7 +92,7 @@ module Jekyll # as well as the beginning "/" so we can enforce and ensure it. def sanitize_url(str) - "/" + str.gsub(/\/{2,}/, "/").gsub(%r!\.+\/|\A/+!, "") + "/" + str.gsub(/\/{2,}/, "/").gsub(/\.+\/|\A\/+/, "") end # Escapes a path to be a valid URL path segment