Skip to content

CSV breaks if we enter a multiline comment that includes new line characters #58

@demeringo

Description

@demeringo

Bug description

The data CSV file breaks if we submit a field that contains multiline text (a text that contains new line characters).

  1. The CSV generated by Datami widget does not seem to include quotes around the fields.
  2. and/or the newline ( '\n' ) chars are not escaped by the form.

The resulting CSV is broken into multilines and

  1. the CSV validation fails in CI
  2. even if we bypass the validation, the resulting CSV will not be loaded correctly in a next iteration by the widget.

To Reproduce

  1. Open the widget in edition at: https://boavizta.github.io/ict-sustainability-tools/
  2. Edit a multiline field using the widget (for example use enter key in the quick_description field).
  3. Submit the form.

Example of broken PR: #57

Expected behavior

Either make Datami widget quote the values in the CSV or/and escape new line character prior to submitting the form.

JSON OUTPUT

Additional context

Maybe I miss something obvious in the way to configure the widget to prevent this behaviour....

If we cannot fix it, we may also just completly forbid multiline (or long) text. But this may be impractical to display and edit the description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions