Fix regexp literal issues on master.

This commit is contained in:
Parker Moore 2016-06-03 22:10:15 -07:00
parent 8917fa8282
commit f5a8000baa
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
1 changed files with 2 additions and 2 deletions

View File

@ -72,13 +72,13 @@ module Jekyll
# Remove leading "/" to avoid generating urls with `//` # Remove leading "/" to avoid generating urls with `//`
result.gsub(%r!/:#{token.first}!, "") result.gsub(%r!/:#{token.first}!, "")
else else
result.gsub(/:#{token.first}/, self.class.escape_path(token.last)) result.gsub(%r!:#{token.first}!, self.class.escape_path(token.last))
end end
end end
end end
def generate_url_from_drop(template) def generate_url_from_drop(template)
template.gsub(/:([a-z_]+)/) do |match| template.gsub(%r!:([a-z_]+)!) do |match|
replacement = @placeholders.public_send(match.sub(":".freeze, "".freeze)) replacement = @placeholders.public_send(match.sub(":".freeze, "".freeze))
if replacement.nil? if replacement.nil?
"".freeze "".freeze