Simplify conversation title sanitization
Browse filesReplaces the previous complex sanitization logic for conversation titles with a simple trim operation. This change removes emoji and tag stripping, now only trimming whitespace from titles.
- src/routes/+layout.ts +3 -8
src/routes/+layout.ts
CHANGED
|
@@ -23,14 +23,9 @@ export const load = async ({ depends, fetch, url }) => {
|
|
| 23 |
|
| 24 |
const { conversations: rawConversations, nConversations } = conversationsData;
|
| 25 |
const conversations = rawConversations.map((conv) => {
|
| 26 |
-
const
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
.replace(/<\/?think>/gi, "")
|
| 30 |
-
.replace(/\uFFFD/gu, "")
|
| 31 |
-
.trimStart();
|
| 32 |
-
|
| 33 |
-
conv.title = sanitizedTitle;
|
| 34 |
|
| 35 |
return {
|
| 36 |
id: conv._id.toString(),
|
|
|
|
| 23 |
|
| 24 |
const { conversations: rawConversations, nConversations } = conversationsData;
|
| 25 |
const conversations = rawConversations.map((conv) => {
|
| 26 |
+
const trimmedTitle = conv.title.trim();
|
| 27 |
+
|
| 28 |
+
conv.title = trimmedTitle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
return {
|
| 31 |
id: conv._id.toString(),
|