Action

Trim

Posted by latca, Last update over 5 years ago

Trims white space from the beginning and end of each line in the draft.

Steps

  • script

    var content = draft.content;
    var lines = content.split('\n');
    var numLines = lines.length;
    var out = [];
    for (var i=0; i<numLines; i++) {
    	out.push(lines[i].trim());
    }
    draft.content = out.join('\n');
    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.