Timothy Jaeryang Baek 5 tháng trước cách đây
mục cha
commit
b1d31d9b8e
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/lib/components/chat/Messages/CitationsModal.svelte

+ 3 - 1
src/lib/components/chat/Messages/CitationsModal.svelte

@@ -1,4 +1,6 @@
 <script lang="ts">
+	import DOMPurify from 'dompurify';
+
 	import { getContext, onMount, tick } from 'svelte';
 	import Modal from '$lib/components/common/Modal.svelte';
 	import Tooltip from '$lib/components/common/Tooltip.svelte';
@@ -150,7 +152,7 @@
 						</div>
 						<pre class="text-sm dark:text-gray-400 whitespace-pre-line">
 							{#if document.metadata?.html}
-								{@html document.document}
+								{@html DOMPurify(document.document)}
 							{:else}
 								{document.document}
 							{/if}