Action

✪ #-

Posted by Mirko, Last update almost 6 years ago

This action can decrease heading level just like Ulysses

Steps

  • script

    var allLine = editor.getSelectedLineRange();
    var allText = editor.getTextInRange(allLine[0],allLine[1]);
    
    var con = allText.split(" ",);
    var arr = con[0];
    var ver = 0;
    
    for(var i=0;i<arr.length;i++){
        if(arr[i]=="#"){
        ver++;}
    };
    
        if(ver==arr.length && con.length>1 && arr.length>0){
        var newText = allText.substr(1,);
        editor.setTextInRange(allLine[0],allLine[1],newText);
    }

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.