From f1426b18996a99e61a50a6c942148989363d6525 Mon Sep 17 00:00:00 2001 From: Maximus Bale Date: Fri, 16 Mar 2018 14:40:59 +0800 Subject: [PATCH 1/2] Fix windows: path vs url --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6434fce..3f596fe 100755 --- a/index.js +++ b/index.js @@ -104,7 +104,8 @@ function render(data, done) { // temporary fix for phantomjs+windows if (/^[a-z]\:\\/i.test(input[0])) { - input[0] = 'file:///' + input[0]; + input[0] = input[0].replace(/\\/g, "/"); + input[0] = 'file://' + input[0]; } outputs.forEach(function(output) { From cef792d8b3f03fe36392d82407bac69de857c14c Mon Sep 17 00:00:00 2001 From: Maximus Bale Date: Fri, 16 Mar 2018 17:34:55 +0800 Subject: [PATCH 2/2] encode url for it is an url --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3f596fe..c30bd1f 100755 --- a/index.js +++ b/index.js @@ -105,7 +105,8 @@ function render(data, done) { // temporary fix for phantomjs+windows if (/^[a-z]\:\\/i.test(input[0])) { input[0] = input[0].replace(/\\/g, "/"); - input[0] = 'file://' + input[0]; + input[0] = 'file://' + input[0]; // three slash!!! + input[0] = encodeURI(input[0]); // for non-Engilish characters and white spaces } outputs.forEach(function(output) {