Skip to content

fix(ui): ExportMenu CSV serializer does not quote fields containing newlines #411

@github-actions

Description

@github-actions

Summary

The CSV serializer in ExportMenu.tsx only quotes fields that contain commas, but does not handle values containing \n or \r. A single cell with embedded newlines will be emitted as multiple CSV rows, producing a malformed export file.

Affected file

src/UILayer/web/src/components/shared/ExportMenu.tsx — line 23

Required fix

const needsQuoting = (val: string) =>
  val.includes(',') || val.includes('"') || val.includes('\n') || val.includes('\r')

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions