@rspress/runtime 1.5.1 → 1.6.1
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/utils.js +3 -2
- package/package.json +4 -4
- package/src/utils.ts +3 -1
package/dist/utils.js
CHANGED
@@ -7,7 +7,8 @@ import {
|
|
7
7
|
normalizeHref,
|
8
8
|
withBase as rawWithBase,
|
9
9
|
removeBase as rawRemoveBase,
|
10
|
-
isExternalUrl
|
10
|
+
isExternalUrl,
|
11
|
+
removeHash
|
11
12
|
} from "@rspress/shared";
|
12
13
|
function normalizeRoutePath(routePath) {
|
13
14
|
return decodeURIComponent(routePath).replace(/\.html$/, "").replace(/\/index$/, "/");
|
@@ -19,7 +20,7 @@ function removeBase(url) {
|
|
19
20
|
return rawRemoveBase(url, siteData.base);
|
20
21
|
}
|
21
22
|
function isEqualPath(a, b) {
|
22
|
-
return withBase(normalizeHrefInRuntime(a)) === withBase(normalizeHrefInRuntime(b));
|
23
|
+
return withBase(normalizeHrefInRuntime(removeHash(a))) === withBase(normalizeHrefInRuntime(removeHash(b)));
|
23
24
|
}
|
24
25
|
function normalizeHrefInRuntime(a) {
|
25
26
|
const cleanUrls = Boolean(siteData?.route?.cleanUrls);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/runtime",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.6.1",
|
4
4
|
"description": "The Runtime of Rspress Documentation Framework",
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
6
6
|
"repository": {
|
@@ -34,11 +34,11 @@
|
|
34
34
|
"react-dom": "^18.2.0",
|
35
35
|
"react-helmet-async": "^1.3.0",
|
36
36
|
"react-router-dom": "^6.8.1",
|
37
|
-
"@rspress/shared": "1.
|
37
|
+
"@rspress/shared": "1.6.1"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@modern-js/tsconfig": "2.
|
41
|
-
"@modern-js/types": "2.
|
40
|
+
"@modern-js/tsconfig": "2.40.0",
|
41
|
+
"@modern-js/types": "2.40.0",
|
42
42
|
"@types/jest": "^26.0.9",
|
43
43
|
"@types/react": "^18",
|
44
44
|
"@types/react-dom": "^18",
|
package/src/utils.ts
CHANGED
@@ -8,6 +8,7 @@ import {
|
|
8
8
|
withBase as rawWithBase,
|
9
9
|
removeBase as rawRemoveBase,
|
10
10
|
isExternalUrl,
|
11
|
+
removeHash,
|
11
12
|
} from '@rspress/shared';
|
12
13
|
|
13
14
|
export function normalizeRoutePath(routePath: string) {
|
@@ -26,7 +27,8 @@ export function removeBase(url: string): string {
|
|
26
27
|
|
27
28
|
export function isEqualPath(a: string, b: string) {
|
28
29
|
return (
|
29
|
-
withBase(normalizeHrefInRuntime(a)) ===
|
30
|
+
withBase(normalizeHrefInRuntime(removeHash(a))) ===
|
31
|
+
withBase(normalizeHrefInRuntime(removeHash(b)))
|
30
32
|
);
|
31
33
|
}
|
32
34
|
|