浏览代码

refac: banner newlines

Timothy Jaeryang Baek 3 月之前
父节点
当前提交
3f800c069e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/lib/components/common/Banner.svelte

+ 3 - 2
src/lib/components/common/Banner.svelte

@@ -36,6 +36,8 @@
 
 
 	onMount(() => {
 	onMount(() => {
 		mounted = true;
 		mounted = true;
+
+		console.log('Banner mounted:', banner);
 	});
 	});
 </script>
 </script>
 
 
@@ -82,9 +84,8 @@
 						</div>
 						</div>
 					{/if}
 					{/if}
 				</div>
 				</div>
-
 				<div class="flex-1 text-xs text-gray-700 dark:text-white max-h-60 overflow-y-auto">
 				<div class="flex-1 text-xs text-gray-700 dark:text-white max-h-60 overflow-y-auto">
-					{@html marked.parse(DOMPurify.sanitize(banner.content))}
+					{@html marked.parse(DOMPurify.sanitize((banner?.content ?? '').replace(/\n/g, '<br>')))}
 				</div>
 				</div>
 			</div>
 			</div>