mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-01 07:45:01 -04:00
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:
parent
81ff6c0baf
commit
1d8e3af457
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user