소스 검색

Don't double escape twitter text

Thomas Dy 3 년 전
부모
커밋
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 {