victor HF Staff commited on
Commit
463dd4e
·
1 Parent(s): 80094f9

Simplify conversation title sanitization

Browse files

Replaces 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.

Files changed (1) hide show
  1. 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 sanitizedTitle = conv.title
27
- // strip pictographic emoji while keeping ASCII digits (\p{Emoji} also matches 0-9)
28
- .replace(/\p{Extended_Pictographic}|\u200d|\ufe0f/gu, "")
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(),