fix front hbs image helpers
Showing
1 changed file
with
6 additions
and
1 deletions
@@ -3,6 +3,11 @@ module.exports = function (url, opts) { | @@ -3,6 +3,11 @@ module.exports = function (url, opts) { | ||
3 | let params = opts.hash; | 3 | let params = opts.hash; |
4 | let urls = url.split('?'); | 4 | let urls = url.split('?'); |
5 | let query = urls[1] || ''; | 5 | let query = urls[1] || ''; |
6 | + let uri = urls[0]; | ||
7 | + | ||
8 | + if (uri.indexOf('http:') === 0) { | ||
9 | + uri = uri.replace('http:', ''); | ||
10 | + } | ||
6 | 11 | ||
7 | if (query) { | 12 | if (query) { |
8 | query = query.replace(/{width}/g, params.w).replace(/{height}/g, params.h).replace(/{mode}/g, (params.mode || 2)); | 13 | query = query.replace(/{width}/g, params.w).replace(/{height}/g, params.h).replace(/{mode}/g, (params.mode || 2)); |
@@ -23,7 +28,7 @@ module.exports = function (url, opts) { | @@ -23,7 +28,7 @@ module.exports = function (url, opts) { | ||
23 | } else { | 28 | } else { |
24 | query = 'imageView2/2/interlace/1/q/' + (params.q || 75); | 29 | query = 'imageView2/2/interlace/1/q/' + (params.q || 75); |
25 | } | 30 | } |
26 | - return urls[0] + '?' + query; | 31 | + return uri + '?' + query; |
27 | } else { | 32 | } else { |
28 | return url; | 33 | return url; |
29 | } | 34 | } |
-
Please register or login to post a comment