nextcloud / nextcloud/deck

Malformed CSV when exporting board

Open
#7,782 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.4k
Forks
354
Avg merge
1d 10h
Merged PRs (30d)
43

Description

Summary

Users can export a board to a csv file. If the card's description contains markdown close to deck's csv dialect, it is not escaped and parsing the exported csv file becomes ambiguous.

To Reproduce
  1. Enable Deck
  2. Create a board
  3. Scaffold some cards
  4. Type some double quotation marks " in a description field
  5. Export the board as csv
  6. Open the board with (a text editor|LibreOffice Calc|pandas)
Expected behavior

Opening the exported file with LibreOffice Calc shows the board's cards as a table.

import csv
import pandas
board = pandas.read_csv(
    'exported_file_from_nextcloud.csv',
    encoding='utf-16',
    delimiter='\t',
    quotechar='"',
    quoting=csv.QUOTE_ALL,
    header=0,
)
Mitigation/Discussion

Until the exporter is fixed for general users, you can convert the exported csv dialect.

  • The first " of a file is a real delimiter.
  • The last " of a file is a real delimiter.
  • "\t" are real delimiters.
  • "\n" are real delimiters. every other " is a character inside a field.

Although with this mitigation the exported files are not broken beyond repair, the value for general users is quite limited since the exported dialect is outside of the range which is considered as input by general tools. A more compliant export dialect should be considered. I propose LibreOffice Calc and/or pandas as a benchmark.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the board CSV export entry point and reproduce the issue with double quotation marks in a card description. Compare the output with LibreOffice Calc and the provided pandas reader; done means exported descriptions are escaped so the file parses as a normal table.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.