Action

Remove Blank Lines

Posted by agiletortoise, Last update 12 months ago

Remove empty lines from the selection.

Steps

  • script

    let selectedText = editor.getSelectedText()
    const [st, len] = editor.getSelectedRange()
    
    selectedText = selectedText.replaceAll("\r", "")
    selectedText = selectedText.replace(/\n(\s+)?\n/gm, "\n")
    
    editor.setSelectedText(selectedText)
    editor.setSelectedRange(st, selectedText.length)

Options

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