@rspress/runtime 0.0.0-nightly-20231205160253 → 0.0.0-nightly-20231206160206

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 CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  withBase as rawWithBase,
9
9
  removeBase as rawRemoveBase,
10
10
  isExternalUrl,
11
+ isDataUrl,
11
12
  removeHash
12
13
  } from "@rspress/shared";
13
14
  function normalizeRoutePath(routePath) {
@@ -28,7 +29,10 @@ function normalizeHrefInRuntime(a) {
28
29
  }
29
30
  function normalizeImagePath(imagePath) {
30
31
  const isProd = isProduction();
31
- if (isExternalUrl(imagePath) || !isProd) {
32
+ if (!isProd) {
33
+ return imagePath;
34
+ }
35
+ if (isExternalUrl(imagePath) || isDataUrl(imagePath)) {
32
36
  return imagePath;
33
37
  }
34
38
  return withBase(imagePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/runtime",
3
- "version": "0.0.0-nightly-20231205160253",
3
+ "version": "0.0.0-nightly-20231206160206",
4
4
  "description": "The Runtime of Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -34,7 +34,7 @@
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": "0.0.0-nightly-20231205160253"
37
+ "@rspress/shared": "0.0.0-nightly-20231206160206"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@modern-js/tsconfig": "2.41.0",
package/src/utils.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  withBase as rawWithBase,
9
9
  removeBase as rawRemoveBase,
10
10
  isExternalUrl,
11
+ isDataUrl,
11
12
  removeHash,
12
13
  } from '@rspress/shared';
13
14
 
@@ -39,7 +40,10 @@ export function normalizeHrefInRuntime(a: string) {
39
40
 
40
41
  export function normalizeImagePath(imagePath: string) {
41
42
  const isProd = isProduction();
42
- if (isExternalUrl(imagePath) || !isProd) {
43
+ if (!isProd) {
44
+ return imagePath;
45
+ }
46
+ if (isExternalUrl(imagePath) || isDataUrl(imagePath)) {
43
47
  return imagePath;
44
48
  }
45
49