fix(web): omit underlines on markdown image links (#17728)

This commit is contained in:
Saikrishna Ambeti authored and GitHub committed 2026-10-10 06:01:08 -05:00
1 parent 6266af3f1f
commit d6f3af7719
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -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"] ?? "",
);
@@ -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"}
@@ -3093,7 +3095,7 @@ const CHAT_MARKDOWN_COMPONENTS = {
});
}}
>
{faviconHost && hastHasText(node) && !isPullRequestAutolink ? (
{faviconHost && hasText && !isPullRequestAutolink ? (
<MarkdownExternalLinkContent host={faviconHost} plainText={plainHastText(node)}>
{linkChildren}
</MarkdownExternalLinkContent>
+2 -2
View File
@@ -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;