Fix copypasting from responses page resulting in wrong paragraph/newline placement#3328
Merged
Conversation
Collaborator
|
@jancborchardt thanks for the contribution :) Just some prettier issues left in the code. Other than that it looks good from my side. |
…ine placement, fix #975 AI-assisted: Claude Code (Sonnet 4.6) Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
af9ee8e to
46f57b2
Compare
jancborchardt
commented
May 11, 2026
Member
Author
jancborchardt
left a comment
There was a problem hiding this comment.
@Chartman123 ah sorry, forgot to run the linter! :) Did now and issues are fixed.
Chartman123
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #975, as it is a recurring annoyance I have. :D
I often copy individual submissions directly from the responses/results view of a form, without going through the structured process of creating a spreadsheet or exporting it.
While the visual styling of the responses looks good, what comes out when copying it and pasting it as plain text has empty lines in the wrong places.
Visually it looks like this on the responses/results page:
But when copy-pasting it from the page into a text editor, it comes out like this:
AI-assisted: Claude Code (Sonnet 4.6)
The key insight: browsers give h1–h6 elements a special extra newline in clipboard text regardless of CSS. The new serializeNode method walks the actual DOM selection and treats all
block elements — including headings — uniformly (one newline each). The .answer div gets a leading \n to produce the blank line separator between questions, matching the visual
layout.
This means: