Skip to content

Commit

Permalink
MM-53298: Fix the export to CSV issue if card property contains # (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat-Dabade authored Sep 10, 2024
1 parent 407b2f6 commit e1bbcbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/src/csvExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ const hashSignToken = '___hash_sign___'
class CsvExporter {
static exportTableCsv(board: Board, activeView: BoardView, cards: Card[], intl: IntlShape, view?: BoardView): void {
const viewToExport = view ?? activeView

if (!viewToExport) {
return
}

const rows = CsvExporter.generateTableArray(board, cards, viewToExport, intl)

let csvContent = 'data:text/csv;charset=utf-8,'
let csvContent = ''

rows.forEach((row) => {
const encodedRow = row.join(',')
csvContent += encodedRow + '\r\n'
})

const encodedUri = encodeURI(csvContent).replace(hashSignToken, '%23')
const encodedUri = 'data:text/csv;charset=utf-8,' + encodeURIComponent(csvContent)

const filename = `${Utils.sanitizeFilename(viewToExport.title || 'Untitled')}.csv`
const link = document.createElement('a')
Expand Down

0 comments on commit e1bbcbc

Please sign in to comment.