From a62d883a769d5ca4d7b7e1817e95d64820c7449e Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Tue, 12 Oct 2021 16:46:17 +0800 Subject: [PATCH] keyword highlight! --- src/Message.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Message.svelte b/src/Message.svelte index ca031b9..d1888de 100644 --- a/src/Message.svelte +++ b/src/Message.svelte @@ -50,7 +50,7 @@ {msg.from_name} 的头像
{msg.from_name || ' '}
-
{msg.text}
+
{@html msg.html}
@@ -72,10 +72,13 @@ white-space: nowrap; color: #1e90ff; } - pre { + .text { white-space: pre-wrap; margin: 0.2em 0; } + .text >:global(.keyword) { + background-color: #ffffab; + } .time { font-size: 0.75em; float: right;