From 028769b73f1861e593b5bd6c723773a37b97f6cb Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Mon, 24 Feb 2014 15:14:10 -0600 Subject: [PATCH] Ignore protocol relative '//' urls. --- plugins/octopress_filters.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb index 091f75a..c07224f 100644 --- a/plugins/octopress_filters.rb +++ b/plugins/octopress_filters.rb @@ -78,8 +78,8 @@ module OctopressLiquidFilters # Replaces relative urls with full urls def expand_urls(input, url='') url ||= '/' - input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\"'>]*)/ do - $1+url+$3 + input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\/\"'>]*)(["|']{1})/ do + $1 + expand_url($3, url) + $4 end end