From 4d70ed07ff7bc752ec271ae31941f50413a5ebb6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 22 Oct 2026 07:14:26 +0900 Subject: [PATCH] refac --- .../components/common/FileItemModal.svelte | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/lib/components/common/FileItemModal.svelte b/src/lib/components/common/FileItemModal.svelte index 3969bc48fb..289f08aa6c 100644 --- a/src/lib/components/common/FileItemModal.svelte +++ b/src/lib/components/common/FileItemModal.svelte @@ -11,7 +11,7 @@ import { getFileById, getFileContentById } from '$lib/apis/files'; import CodeBlock from '$lib/components/chat/Messages/CodeBlock.svelte'; - import Markdown from '$lib/components/chat/Messages/Markdown.svelte'; + import MarkdownDocument from '$lib/components/chat/FileNav/MarkdownDocument.svelte'; const i18n: any = getContext('i18n'); @@ -72,7 +72,7 @@ $: isMarkdown = item?.meta?.content_type === 'text/markdown' || - (item?.name && item?.name.toLowerCase().endsWith('.md')); + (item?.name && /\.(md|markdown|mdx)$/i.test(item.name)); $: isCode = item?.name && @@ -442,10 +442,8 @@ rawContent.length > CONTENT_PREVIEW_LIMIT && !expandedContent} {#if $settings?.renderMarkdownInPreviews ?? true} -
- + @@ -474,10 +472,8 @@ rawContent.length > CONTENT_PREVIEW_LIMIT && !expandedContent} {#if $settings?.renderMarkdownInPreviews ?? true} -
- + @@ -557,10 +553,8 @@ />
{:else if isMarkdown} -
- +
+
{:else if isDocx} {#if docxError}