Replace single line breaks with double line breaks

By email:

replace a single ‘return’ with two ‘returns’ when copying and pasting a block of text.

I use Agenda notetaking app, which uses line spacing to create space between paragraphs, but when pasting text from Agenda into most other places, that visual separation between paras is lost, and can only be recreated by manually adding returns. Or an extra step of a boring search and replace in TextEdit.

This snippet ought to do it:

// #popclip
// name: Double Line Breaks
// icon: symbol:arrow.down.to.line
// language: javascript
const doubled = popclip.input.text.replaceAll("\n", "\n\n");
popclip.pasteText(doubled);

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)

To perform the transformation while copying, hold the Shift key when performing the action on the source text and it will copy the modified text to the clipboard.

Example:

CleanShot 2025-10-22 at 08.30.12

3 Likes