Action

Accept Critic Markup

Posted by @nahumck, Last update over 5 years ago - Unlisted

Create a new MMD file with committed Critic Markup changes.

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
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.