fix: long hyperlinks should be wrapped at word boundaries, closed #4447

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-09-05 23:31:34 +08:00
parent 0e07f59c6a
commit 530e18ecc1
2 changed files with 9 additions and 8 deletions
@@ -1,5 +1,4 @@
import { Button } from "@follow/components/ui/button/index.js"
import { MagneticHoverEffect } from "@follow/components/ui/effect/MagneticHoverEffect.js"
import type { LinkProps } from "@follow/components/ui/link/LinkWithTooltip.js"
import {
Tooltip,
@@ -49,10 +48,12 @@ export const MarkdownLink: Component<LinkProps> = (props) => {
return (
<Tooltip delayDuration={0}>
<TooltipTrigger asChild>
<MagneticHoverEffect
as="a"
<a
draggable="false"
className={cn("text-text font-semibold no-underline", props.className)}
className={cn(
"text-text follow-link--underline font-semibold no-underline",
props.className,
)}
href={populatedFullHref}
title={props.title}
target="_blank"
@@ -64,7 +65,7 @@ export const MarkdownLink: Component<LinkProps> = (props) => {
{typeof props.children === "string" && (
<i className="i-mgc-arrow-right-up-cute-re size-[0.9em] translate-y-[2px] opacity-70" />
)}
</MagneticHoverEffect>
</a>
</TooltipTrigger>
{!!populatedFullHref && (
<TooltipPortal>
@@ -58,10 +58,10 @@ const AIEntryLayoutImpl = () => {
{realEntryId && (
<m.div
lcpOptimization
initial={{ y: 150, opacity: 0, scale: 0.98 }}
initial={{ y: 50, opacity: 0, scale: 0.98 }}
animate={{ y: 0, opacity: 1, scale: 1 }}
exit={{ y: 150, opacity: 0, scale: 0.98 }}
transition={Spring.presets.smooth}
exit={{ y: 50, opacity: 0, scale: 0.98 }}
transition={Spring.smooth(0.3)}
className="bg-theme-background absolute inset-0 z-10 border-l"
>
<EntryContent entryId={realEntryId} className="h-full" />