Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/src/components/ChatMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,7 @@ const CHAT_MARKDOWN_COMPONENTS = {
: null;
if (!fileLinkMeta) {
const faviconHost = resolveExternalWebLinkHost(href);
const hasText = hastHasText(node);
const pullRequestAutolink = String(
(props as Record<string, unknown>)["data-pull-request-autolink"] ?? "",
);
Expand Down Expand Up @@ -2974,6 +2975,7 @@ const CHAT_MARKDOWN_COMPONENTS = {
{...props}
className={cn(props.className, pullRequestAutolink === "commit" && "font-mono")}
data-markdown-copy={pullRequestCopy}
data-markdown-image-link={!hasText || undefined}
href={href}
target={isSameDocumentLink ? undefined : "_blank"}
rel={isSameDocumentLink ? undefined : "noopener noreferrer"}
Expand Down Expand Up @@ -3093,7 +3095,7 @@ const CHAT_MARKDOWN_COMPONENTS = {
});
}}
>
{faviconHost && hastHasText(node) && !isPullRequestAutolink ? (
{faviconHost && hasText && !isPullRequestAutolink ? (
<MarkdownExternalLinkContent host={faviconHost} plainText={plainHastText(node)}>
{linkChildren}
</MarkdownExternalLinkContent>
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1895,8 +1895,8 @@ code {
color: var(--info-foreground);
}

.chat-markdown a:not(.chat-markdown-file-link):hover,
.chat-markdown a:not(.chat-markdown-file-link):focus-visible {
.chat-markdown a:not(.chat-markdown-file-link, [data-markdown-image-link]):hover,
.chat-markdown a:not(.chat-markdown-file-link, [data-markdown-image-link]):focus-visible {
background-image: radial-gradient(circle, currentcolor 0.75px, transparent 1px);
background-position: left bottom;
background-repeat: repeat-x;
Expand Down
Loading