Action

Move Done Items

Posted by @hinnerkhaardt, Last update over 6 years ago

Moves done Markdown items – looking like „- [x]“ – to the end of the draft.

Steps

  • script

    var lines = draft.content.split(/\r?\n/),
    ll = lines.length,
    top = [],
    bottom = [];
    
    for (var i = 0; i < ll; i++) {
        if (lines[i].startsWith('- [x]')) {
        bottom.push(lines[i]);
        } else {
        top.push(lines[i]);
        }
    }
    
    draft.content = top.join('\n') + '\n' + bottom.join('\n');
    

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.