Drafts Action Directory

Accept Critic Markup

Posted by @nahumck, Last update 3 months ago - Unlisted

Create a new MMD file with committed Critic Markup changes.

Install

Steps

  • script

    /* --- Remove Critic Markup Elements --- */
    // {--deletion--} 
    // {~~sub~>substitution~~} 
    // {++addition++}
    // {==highlight==}
    // {>>comment<<}
    let content = draft.content;
    content = content.replace(/\{>>.*<<\}|\{--.*--\}|\{==|==\}|\{\+\+|\+\+\}|\{~~.*~>|~~\}/gi, "");
    
    // Create new draft processed draft in standard Markdown
    var d = Draft.create();
    d.content = content
    d.languageGrammar = "Markdown";
    d.update();
    editor.load(d);

Options

  • After Success Nothing
    Notification Info
    Log Level Error
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.