Don't add quotation marks if they are already present

master
Nikola Forró 7 years ago
parent 0785e55d79
commit 7ef3a0fc81

@ -96,7 +96,11 @@ export class QuotesComponent implements OnInit, AfterViewInit {
for (const quote of quotes) { for (const quote of quotes) {
let date = new DatePipe('en-US-POSIX').transform(quote.date, 'dd/MM/yyyy'); 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, { let data = new Blob(lines, {

Loading…
Cancel
Save