From fa96843555091655fb028c9e9458735526e90449 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 22 Sep 2016 20:58:26 -0700 Subject: [PATCH] URLFilters: Simplify ensure_leading_slash calls. --- lib/jekyll/filters/url_filters.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/jekyll/filters/url_filters.rb b/lib/jekyll/filters/url_filters.rb index de700aa7..39f60230 100644 --- a/lib/jekyll/filters/url_filters.rb +++ b/lib/jekyll/filters/url_filters.rb @@ -22,12 +22,9 @@ module Jekyll return if input.nil? site = @context.registers[:site] return ensure_leading_slash(input.to_s) if site.config["baseurl"].nil? - ensure_leading_slash( # in case the baseurl doesn't have a leading slash - URI( - site.config["baseurl"] + ensure_leading_slash(input.to_s) - # in case the input doesn't have a leading slash - ).to_s - ) + URI( + ensure_leading_slash(site.config["baseurl"]) + ensure_leading_slash(input.to_s) + ).to_s end private