@rspress/shared 2.0.0-beta.13 → 2.0.0-beta.14

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/node-utils.js +10 -4
  2. package/package.json +1 -1
@@ -8,11 +8,17 @@ const extractTextAndId = (title)=>{
8
8
  ''
9
9
  ];
10
10
  const customIdReg = /\\?{#.*}/;
11
- const text = title.replace(customIdReg, '').trimEnd();
12
- const customId = title.match(customIdReg)?.[0]?.slice(2, -1) || '';
11
+ if (customIdReg.test(title)) {
12
+ const text = title.replace(customIdReg, '').trimEnd();
13
+ const customId = title.match(customIdReg)?.[0]?.slice(2, -1) || '';
14
+ return [
15
+ text,
16
+ customId
17
+ ];
18
+ }
13
19
  return [
14
- text,
15
- customId
20
+ title,
21
+ ''
16
22
  ];
17
23
  };
18
24
  function getIconUrlPath(icon) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "2.0.0-beta.13",
3
+ "version": "2.0.0-beta.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/web-infra-dev/rspress.git",