Showing
1 changed file
with
4 additions
and
2 deletions
@@ -15,10 +15,12 @@ exports.handleOrderList = (data, w, h) => { | @@ -15,10 +15,12 @@ exports.handleOrderList = (data, w, h) => { | ||
15 | } | 15 | } |
16 | 16 | ||
17 | function replaceWH(img) { | 17 | function replaceWH(img) { |
18 | - return img.replace(/(\{width\}|\{height\})/g, function($0) { | 18 | + return img.replace(/(^https?:|\{width\}|\{height\})/g, function($0) { |
19 | const dict = { | 19 | const dict = { |
20 | '{width}': w, | 20 | '{width}': w, |
21 | - '{height}': h | 21 | + '{height}': h, |
22 | + 'http:': '', | ||
23 | + 'https:': '' | ||
22 | }; | 24 | }; |
23 | 25 | ||
24 | return dict[$0]; | 26 | return dict[$0]; |
-
Please register or login to post a comment