Skip to content

Commit

Permalink
fix: incorrect resolve path in window, close #17
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Oct 9, 2020
1 parent cacab8d commit 9d23988
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/imgAutosize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const url = require('url');
const path = require('path');
const http = require('http');
const https = require('https');
const normalizePath = require('normalize-path');
const imageSize = require('image-size');
const ratio = require('./ratio.js');

Expand Down Expand Up @@ -94,7 +95,7 @@ function translatePath(projectRoot, htmlRelativePath, imgPath, isQuestionMarkAsV
return imgAbsolutePath.replace(/\?[^/]*/, '');
}

return imgAbsolutePath;
return normalizePath(imgAbsolutePath);
}

function getImageDimensions(imgPath) {
Expand Down
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
"dependencies": {
"image-size": "^0.8.3",
"normalize-path": "^3.0.0",
"nyc": "^15.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit 9d23988

Please sign in to comment.