minista 2.7.4 → 2.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/download.js +8 -2
  2. package/package.json +1 -1
package/dist/download.js CHANGED
@@ -94,9 +94,15 @@ async function downloadFiles(entryPoints, remoteUrl, remoteName, downloadOutDir,
94
94
  }));
95
95
  await Promise.all(targetPages.map(async (targetPage) => {
96
96
  const html = await fs.readFile(targetPage.entryPoint, "utf8");
97
- const reg = new RegExp(targetPage.remoteImgUrls.join("|"), "g");
97
+ const joinedUrl = targetPage.remoteImgUrls.map((url) => {
98
+ return url.replaceAll("&", "&").replaceAll("?", "\\?");
99
+ }).join("|");
100
+ const reg = new RegExp(joinedUrl, "g");
98
101
  function replacer(match) {
99
- const replaceData = imgSrcList.find((item) => item.remoteImgUrl === match);
102
+ const replaceData = imgSrcList.find((item) => {
103
+ const unescapedMatch = match.replaceAll("&", "&");
104
+ return item.remoteImgUrl === unescapedMatch;
105
+ });
100
106
  const localImgUrl = (replaceData == null ? void 0 : replaceData.localImgUrl) || match;
101
107
  return localImgUrl;
102
108
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minista",
3
3
  "description": "Next.js Like Development with 100% Static Generate",
4
- "version": "2.7.4",
4
+ "version": "2.7.5",
5
5
  "bin": {
6
6
  "minista": "./bin/minista.js"
7
7
  },