More options for pasting multi-line text
The new options for Potentially Unsafe Paste warnings are great. I'd like control over the text's line breaks.
If the text box were read-only, I'd propose radio buttons:
This adds radio buttons (which only require one click rather than a drop-down menu's two clicks) for how to treat line breaks: Preserve them, convert them to spaces, or remove them. Clicking a radio button would immediately convert the text in the white preview box.
However, this text box is editable (🤩 I just figured that out), so I'm actually proposing some buttons:
The three buttons would do:
-
Collapse spacing: all space characters would be consolidated, so
a b\nc d
would bea b c d
(as a regex:s/[\s\r\n]+/ /g
) -
Lines → Spaces: all line break characters would become spaces, so
a\r\nb\nc d
would bea b c d
(as a regex:s/\r?\n|\r/ /g
) -
Remove linebreaks: all line break characters would be removed, so
a\r\nb\nc d
would beabc d
(as a regex:s/[\r\n]+//g
)
I don't feel like doctoring another image, but another option would be to have a heading (like my first mockup with radio buttons) for "Spacing:" and then buttons for Collapse and Lines → Spaces and No lines
The bottom row could also contain ⮢ Undo & ⮣ Redo and/or Reset buttons, but that's overkill—this isn't meant to be a power editor and the user can just hit Cancel and paste anew.