Rubocop: Style/RegexpLiteral
This commit is contained in:
parent
e3189e3828
commit
fd8fdd87d3
|
@ -124,7 +124,7 @@ module Jekyll
|
||||||
:template => @collection.url_template,
|
:template => @collection.url_template,
|
||||||
:placeholders => placeholders,
|
:placeholders => placeholders,
|
||||||
})
|
})
|
||||||
end.to_s.gsub /\/$/, ''
|
end.to_s.gsub(/\/$/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the type of the collection if present, nil otherwise.
|
# Returns the type of the collection if present, nil otherwise.
|
||||||
|
|
|
@ -92,7 +92,7 @@ module Jekyll
|
||||||
# as well as the beginning "/" so we can enforce and ensure it.
|
# as well as the beginning "/" so we can enforce and ensure it.
|
||||||
|
|
||||||
def sanitize_url(str)
|
def sanitize_url(str)
|
||||||
"/" + str.gsub(/\/{2,}/, "/").gsub(%r!\.+\/|\A/+!, "")
|
"/" + str.gsub(/\/{2,}/, "/").gsub(/\.+\/|\A\/+/, "")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Escapes a path to be a valid URL path segment
|
# Escapes a path to be a valid URL path segment
|
||||||
|
|
Loading…
Reference in New Issue