Skip to content

fix: quote copied cells so values with delimiters survive paste - #100

Open
RByers wants to merge 1 commit into
jonaraphael:mainfrom
RByers:pastefix
Open

fix: quote copied cells so values with delimiters survive paste#100
RByers wants to merge 1 commit into
jonaraphael:mainfrom
RByers:pastefix

Conversation

@RByers

@RByers RByers commented Sep 4, 2026

Copy link
Copy Markdown

Copying a cell containing the file separator (e.g. a,b in a .csv) and pasting it split the value across cells, because the webview joined raw cell text with the separator and never quoted it, while paste parses with RFC 4180 quoting.

The webview now sends the selected cells as a matrix and the host serializes it with Papa.unparse using the active delimiter, mirroring how paste already parses on the host. This also preserves trailing empty cells on TSV copies (previously eaten by trimEnd) and uses textContent for consistency with the edit path.

Adds round-trip tests for the copy serializer and a webview contract test.

Fixes #81

Copying a cell containing the file separator (e.g. `a,b` in a .csv) and
pasting it split the value across cells, because the webview joined raw
cell text with the separator and never quoted it, while paste parses with
RFC 4180 quoting.

The webview now sends the selected cells as a matrix and the host
serializes it with Papa.unparse using the active delimiter, mirroring how
paste already parses on the host. This also preserves trailing empty
cells on TSV copies (previously eaten by trimEnd) and uses textContent
for consistency with the edit path.

Adds round-trip tests for the copy serializer and a webview contract test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011mdKM44h3kz5FrmrxZT2YN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy-Paste behavior

1 participant