From 7ef3a0fc8180f95545dd30b666e8029fead86097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Sun, 29 Apr 2018 20:30:54 +0200 Subject: [PATCH] Don't add quotation marks if they are already present --- frontend/src/app/quotes/quotes.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/quotes/quotes.component.ts b/frontend/src/app/quotes/quotes.component.ts index 38a502e..7acaf82 100644 --- a/frontend/src/app/quotes/quotes.component.ts +++ b/frontend/src/app/quotes/quotes.component.ts @@ -96,7 +96,11 @@ export class QuotesComponent implements OnInit, AfterViewInit { for (const quote of quotes) { let date = new DatePipe('en-US-POSIX').transform(quote.date, 'dd/MM/yyyy'); - lines.push('"' + quote.text + '" [' + quote.game + '] [' + date + ']\r\n'); + if (quote.text.includes('"')) { + lines.push(quote.text + ' [' + quote.game + '] [' + date + ']\r\n'); + } else { + lines.push('"' + quote.text + '" [' + quote.game + '] [' + date + ']\r\n'); + } } let data = new Blob(lines, {