mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Core: Fix link items text
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-core': patch
|
||||
---
|
||||
|
||||
Fix link items text
|
||||
@@ -116,14 +116,14 @@ function resolveFolderItem(
|
||||
|
||||
const linkResult = link.exec(item);
|
||||
if (linkResult?.groups) {
|
||||
const { icon, url, text } = linkResult.groups;
|
||||
const { icon, url, name } = linkResult.groups;
|
||||
const isRelative =
|
||||
url.startsWith('/') || url.startsWith('#') || url.startsWith('.');
|
||||
|
||||
const node: PageTree.Item = {
|
||||
type: 'page',
|
||||
icon: ctx.options.resolveIcon?.(icon),
|
||||
name: text,
|
||||
name,
|
||||
url,
|
||||
external: !isRelative,
|
||||
};
|
||||
|
||||
@@ -166,12 +166,14 @@ test('Nested Directories', async () => {
|
||||
},
|
||||
{
|
||||
"external": true,
|
||||
"name": "Text",
|
||||
"type": "page",
|
||||
"url": "https://google.com",
|
||||
},
|
||||
{
|
||||
"external": true,
|
||||
"icon": "Icon",
|
||||
"name": "Text",
|
||||
"type": "page",
|
||||
"url": "https://google.com",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user