Selaa lähdekoodia

Don't double escape twitter text

Thomas Dy 3 vuotta sitten
vanhempi
commit
4587d09dcf
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  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 {