Эх сурвалжийг харах

Don't double escape twitter text

Thomas Dy 3 жил өмнө
parent
commit
4587d09dcf
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      format.ts

+ 2 - 1
format.ts

@@ -59,7 +59,8 @@ function buildProxyUrl(url: string): string {
 }
 
 function formatPlainText(text: string): SafeString {
-  return new SafeString(escapeHTML(text).toString().replace(/\n/g, "<br />"));
+  // apparently twitter already escapes the text for you
+  return new SafeString(text.replace(/\n/g, "<br />"));
 }
 
 class TextFormatter {