Action

URL Decode

Posted by ericalinhu, Last update over 1 year ago

Replaced the selection with URL decoded text.

Steps

  • script

    var s = draft.content;
    s = s.replace(/%2525/gm, "\%25");
    s = s.replace(/\+/gm, " ");
    s = s.replace(/%20/gm, " ");
    s = s.replace(/%09/gm, "\t");
    s = s.replace(/%0A/gm, "\n");
    s = s.replace(/%21/gm, "\!");
    s = s.replace(/%22/gm, "\"");
    s = s.replace(/%23/gm, "\#");
    s = s.replace(/%24/gm, "\$");
    s = s.replace(/%25/gm, "\%");
    s = s.replace(/%26/gm, "\&");
    s = s.replace(/%27/gm, "\'");
    s = s.replace(/%28/gm, "\(");
    s = s.replace(/%29/gm, "\)");
    s = s.replace(/%2A/gm, "\*");
    s = s.replace(/%2B/gm, "\+");
    s = s.replace(/%2C/gm, "\,");
    s = s.replace(/%2D/gm, "\-");
    s = s.replace(/%2E/gm, "\.");
    s = s.replace(/%2F/gm, "\/");
    s = s.replace(/%3A/gm, "\:");
    s = s.replace(/%3B/gm, "\;");
    s = s.replace(/%3C/gm, "\<");
    s = s.replace(/%3D/gm, "\=");
    s = s.replace(/%3E/gm, "\>");
    s = s.replace(/%3F/gm, "\?");
    s = s.replace(/%2A/gm, "\*");
    s = s.replace(/%2B/gm, "\+");
    s = s.replace(/%7B/gm, "\|");
    s = s.replace(/%60/gm, "\`");
    s = s.replace(/%5F/gm, "\_");
    
    draft.content = s;
    draft.update();

Options

  • After Success Default
    Notification Error
    Log Level Error
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.