@rspress/shared 1.7.2 → 1.7.4
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.
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -1266,9 +1266,6 @@ function normalizeHref(url, cleanUrls = false) {
|
|
1266
1266
|
return url;
|
1267
1267
|
}
|
1268
1268
|
let { url: cleanUrl2, hash } = parseUrl(decodeURIComponent(url));
|
1269
|
-
if (url.startsWith("mailto:") || url.startsWith("tel:")) {
|
1270
|
-
return url;
|
1271
|
-
}
|
1272
1269
|
const hasExt = cleanUrl2.split("/").pop()?.includes(".");
|
1273
1270
|
if (!cleanUrls && !cleanUrl2.endsWith(".html") && !hasExt) {
|
1274
1271
|
if (cleanUrl2.endsWith("/")) {
|
@@ -1277,6 +1274,9 @@ function normalizeHref(url, cleanUrls = false) {
|
|
1277
1274
|
cleanUrl2 += ".html";
|
1278
1275
|
}
|
1279
1276
|
}
|
1277
|
+
if (cleanUrls && cleanUrl2.endsWith("/")) {
|
1278
|
+
cleanUrl2 += "index";
|
1279
|
+
}
|
1280
1280
|
return addLeadingSlash(hash ? `${cleanUrl2}#${hash}` : cleanUrl2);
|
1281
1281
|
}
|
1282
1282
|
function withoutLang(path, langs) {
|
package/dist/index.mjs
CHANGED
@@ -1209,9 +1209,6 @@ function normalizeHref(url, cleanUrls = false) {
|
|
1209
1209
|
return url;
|
1210
1210
|
}
|
1211
1211
|
let { url: cleanUrl2, hash } = parseUrl(decodeURIComponent(url));
|
1212
|
-
if (url.startsWith("mailto:") || url.startsWith("tel:")) {
|
1213
|
-
return url;
|
1214
|
-
}
|
1215
1212
|
const hasExt = cleanUrl2.split("/").pop()?.includes(".");
|
1216
1213
|
if (!cleanUrls && !cleanUrl2.endsWith(".html") && !hasExt) {
|
1217
1214
|
if (cleanUrl2.endsWith("/")) {
|
@@ -1220,6 +1217,9 @@ function normalizeHref(url, cleanUrls = false) {
|
|
1220
1217
|
cleanUrl2 += ".html";
|
1221
1218
|
}
|
1222
1219
|
}
|
1220
|
+
if (cleanUrls && cleanUrl2.endsWith("/")) {
|
1221
|
+
cleanUrl2 += "index";
|
1222
|
+
}
|
1223
1223
|
return addLeadingSlash(hash ? `${cleanUrl2}#${hash}` : cleanUrl2);
|
1224
1224
|
}
|
1225
1225
|
function withoutLang(path, langs) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/shared",
|
3
|
-
"version": "1.7.
|
3
|
+
"version": "1.7.4",
|
4
4
|
"types": "./dist/index.d.ts",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.mjs",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
}
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@rsbuild/core": "0.0
|
25
|
+
"@rsbuild/core": "0.1.0",
|
26
26
|
"unified": "10.1.2",
|
27
27
|
"chalk": "4.1.2",
|
28
28
|
"rslog": "^1.1.0"
|