fix: fix link func display

This commit is contained in:
YanCore 2025-06-07 09:38:43 +08:00 committed by GitHub
parent 7a4be07dd1
commit 41c0f9fb65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,8 +26,8 @@ export function formatValue(
function formatObject(value: any) {
const type = value.type;
if (type === 'file') {
const fileName = value.path.split('/').pop().replace(/\.md$/, '')
return {type: "link", path: value.path, display: fileName};
const display = value.display !== undefined ? value.display : value.path.split('/').pop().replace(/\.md$/, '');
return {type: "link", path: value.path, display: display};
}
if ("path" in value && "display" in value) {