From 860ea281390e74b7919aee842ca9f75d011e3489 Mon Sep 17 00:00:00 2001 From: qqmyers Date: Thu, 13 Feb 2025 08:51:08 -0500 Subject: [PATCH] Update spreadsheet.js to handle quotes cells As reported in https://groups.google.com/d/msgid/dataverse-community/ef52665f-2348-413b-9181-0aad860316c1n%40googlegroups.com?utm_medium=email&utm_source=footer, the current previewer isn't handling cells that are in quotes (and have a comma inside them). This PR tries to address that by setting the quoteChar used during parsing. Alternately, we may need to set delimitersToGuess: to avoid all but the correct one for a given mimetype. --- previewers/betatest/js/spreadsheet.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/previewers/betatest/js/spreadsheet.js b/previewers/betatest/js/spreadsheet.js index 200daa5..51f974d 100644 --- a/previewers/betatest/js/spreadsheet.js +++ b/previewers/betatest/js/spreadsheet.js @@ -23,7 +23,8 @@ function writeContent(fileUrl, file, title, authors) { var csv = e.target.result; var data = Papa.parse(csv, { header: true, - skipEmptyLines: true + skipEmptyLines: true, + quoteChar:'"' }) handsontableContainer.innerHTML = ''; @@ -42,4 +43,4 @@ function writeContent(fileUrl, file, title, authors) { request.send(); } - \ No newline at end of file +