Idea: Add double space at the end of each line

I don’t think that a extension for this already exists, that’s why I suggest:

Add/remove the Markdown indication of a forced line break (two spaces at the line end) to each line of the selection.

# popclip
name: Add / Remove line break.
icon: circle filled A/R
actions:
  - title: Add Bread
    icon: circle filled A.
    javascript: |
      const text = popclip.input.text;
      popclip.pasteText(text.split(/\n/).join('  \n') + '  ')
  - title: Remove Break
    icon: circle filled R.
    javascript: |
      const text = popclip.input.text;
      popclip.pasteText(text.trim().split(/\s+\n/).join('\n'))
3 Likes

Hey @dofyyu, works brilliantly! Thanks a lot!

I have done some decorative changes which I might share. Maybe somebody likes them.

# popclip
name: Md Line breaks
icon: circle filled A/R
actions:
  - title: Add Md Breaks
    icon: circle filled A.
    javascript: |
      const text = popclip.input.text;
      popclip.pasteText(text.split(/\n/).join('  \n') + '  ')
  - title: Remove Md Breaks
    icon: circle filled R.
    javascript: |
      const text = popclip.input.text;
      popclip.pasteText(text.trim().split(/\s+\n/).join('\n'))
1 Like