Skip to content

Commit

Permalink
Fix rendering a link containing a soft hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdax98 committed Jan 15, 2025
1 parent 81791a1 commit d8a8db6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions demo/site/src/common/blocks/RichTextBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ const defaultRichTextRenderers: Renderers = {
*/
entities: {
// key is the entity key value from raw
LINK: (children, data: LinkBlockData, { key }) =>
isValidLink(data) ? (
<InlineLink key={key} data={data}>
LINK: (children, data: LinkBlockData, { key }) => {
const mergedKey = key + children?.toString();

return isValidLink(data) ? (
<InlineLink key={mergedKey} data={data}>
{children}
</InlineLink>
) : (
<span>{children}</span>
),
);
},
},
};

Expand Down

0 comments on commit d8a8db6

Please sign in to comment.