فهرست منبع

fix: enable inline link image rendering

Timothy J. Baek 8 ماه پیش
والد
کامیت
2f841f9f5a
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens.svelte

+ 7 - 1
src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens.svelte

@@ -30,7 +30,13 @@
 			{token.text}
 		{/if}
 	{:else if token.type === 'link'}
-		<a href={token.href} target="_blank" rel="nofollow" title={token.title}>{token.text}</a>
+		{#if token.tokens}
+			<a href={token.href} target="_blank" rel="nofollow" title={token.title}>
+				<svelte:self id={`${id}-a`} tokens={token.tokens} />
+			</a>
+		{:else}
+			<a href={token.href} target="_blank" rel="nofollow" title={token.title}>{token.text}</a>
+		{/if}
 	{:else if token.type === 'image'}
 		<Image src={token.href} alt={token.text} />
 	{:else if token.type === 'strong'}