coyotte508 HF staff commited on
Commit
a415295
1 Parent(s): 9726499

🩹 Do not sanitize ½ and other html entities

Browse files
src/lib/components/chat/ChatMessage.svelte CHANGED
@@ -18,11 +18,10 @@
18
  .replaceAll(/<\|[a-z]+\|>/g, " ")
19
  .replaceAll(/<br\s?\/?>/gi, "\n")
20
  .trim()
21
- .replaceAll("&", "&amp;")
22
  .replaceAll("<", "&lt;");
23
  }
24
  function unsanitizeMd(md: string) {
25
- return md.replaceAll("&lt;", "<").replaceAll("&amp;", "&");
26
  }
27
 
28
  export let message: Message;
 
18
  .replaceAll(/<\|[a-z]+\|>/g, " ")
19
  .replaceAll(/<br\s?\/?>/gi, "\n")
20
  .trim()
 
21
  .replaceAll("<", "&lt;");
22
  }
23
  function unsanitizeMd(md: string) {
24
+ return md.replaceAll("&lt;", "<");
25
  }
26
 
27
  export let message: Message;