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 33112a65a8
commit a5f87149fe

View File

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