Skip to content

Commit

Permalink
Issue 271: Fix missing markdown link labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ArLau committed Jan 27, 2025
1 parent 2558e78 commit e0a47c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions changelog/271-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: fix
issue: 271
audience: user
components:
- ui
---

# Fix the missing labels for markdown links
6 changes: 5 additions & 1 deletion packages/ui/src/ReactMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const MarkdownLink: (
!href.includes('://') && !href.startsWith('//') && !href.startsWith('/') && !href.startsWith('#');

const hrefWithNote = isNoteLink ? toNoteURL(href) : href;
const label =
node?.children?.map((child) => (child.type === 'text' ? child.value : '')).join('') || 'no link label';

return (
<Link
Expand All @@ -87,7 +89,9 @@ const MarkdownLink: (
navigateNote(href);
}
}}
/>
>
{label}
</Link>
);
};

Expand Down

0 comments on commit e0a47c2

Please sign in to comment.