fumadocs-core 13.4.7 → 13.4.8

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.
@@ -70,7 +70,7 @@ function resolvePath(from, join) {
70
70
 
71
71
  // src/source/page-tree-builder.ts
72
72
  var group = /^\((?<name>.+)\)$/;
73
- var link = /^\[(?<text>.+)]\((?<url>.+)\)$/;
73
+ var link = /^(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/;
74
74
  var separator = /^---(?<name>.*?)---$/;
75
75
  var rest = "...";
76
76
  var extractPrefix = "...";
@@ -108,15 +108,16 @@ function resolveFolderItem(folder, item, ctx, addedNodePaths) {
108
108
  }
109
109
  const linkResult = link.exec(item);
110
110
  if (linkResult?.groups) {
111
- const { url, text } = linkResult.groups;
111
+ const { icon, url, text } = linkResult.groups;
112
112
  const isRelative = url.startsWith("/") || url.startsWith("#") || url.startsWith(".");
113
113
  const node = {
114
114
  type: "page",
115
+ icon: ctx.options.resolveIcon?.(icon),
115
116
  name: text,
116
117
  url,
117
118
  external: !isRelative
118
119
  };
119
- return [ctx.options.attachFile?.(node) ?? node];
120
+ return [removeUndefined(ctx.options.attachFile?.(node) ?? node)];
120
121
  }
121
122
  const isExcept = item.startsWith(excludePrefix), isExtract = item.startsWith(extractPrefix);
122
123
  let filename = item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "13.4.7",
3
+ "version": "13.4.8",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",