Action

Remove blank lines

Posted by dchar, Last update almost 6 years ago - Unlisted

Remove blank lines.

Steps

  • script

    
    function deblank(s) {
      return s.split('\n').filter(l => l.trim()).join('\n');
    }
    
    var sel = editor.getSelectedText();
    if (sel.length) {
      editor.setSelectedText( deblank(sel) );
    } else {
      draft.content = deblank( draft.content );
      draft.update();
    }
    

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.