Skip to content

Commit

Permalink
πŸ› #731 escape spaces in image paths
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang committed Jun 22, 2020
1 parent 4cfa076 commit bdfed38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function print(type: string) {
} else if (imgExt === "svg") {
imgExt += "+xml";
}
const file = fs.readFileSync(imgSrc).toString('base64');
const file = fs.readFileSync(imgSrc.replace(/%20/g, '\ ')).toString('base64');
return `${p1}data:image/${imgExt};base64,${file}${p3}`;
} catch (e) {
window.showWarningMessage(localize("unableToReadFile") + ` ${imgSrc}, ` + localize("revertingToImagePaths"));
Expand Down

0 comments on commit bdfed38

Please sign in to comment.