expand_urls now correctly matches urls pointing to the root directory, allowing / to be replaced with /subdir/ if site is configured with a different root directory

This commit is contained in:
Brandon Mathis 2011-08-16 00:41:57 -04:00
parent 81ff6c0baf
commit 1d8e3af457

View File

@ -58,7 +58,7 @@ module OctopressFilters
# 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})(\/[^\"'>]+)/ do input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\"'>]*)/ do
$1+url+$3 $1+url+$3
end end
end end