Fixed the expand_url filter. Finally.

Thanks @larryprice
This commit is contained in:
Brandon Mathis 2014-02-24 20:52:26 -06:00
parent 1321423383
commit 0ead88e6c2

View File

@ -78,8 +78,8 @@ module OctopressLiquidFilters
# Replaces relative urls with full urls # Replaces relative urls with full urls
def expand_urls(input, url='') def expand_urls(input, url='')
url ||= '/' url ||= '/'
input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\/\"'>]*)(["|']{1})/ do input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\/>]{1}[^\"'>]*)/ do
$1 + $3 + $4 $1+url+$3
end end
end end