Action

Smart Quotation Marks

Posted by @nahumck, Last update almost 4 years ago

Wraps selected text in quotation marks.

Steps

  • script

    // Apply Markdown code to selection, or insert " if no selection
    var q = "\"";
    var sel = editor.getSelectedText();
    var selRange = editor.getSelectedRange();
    
    if (!sel || sel.length == 0) {
      editor.setSelectedText(q);
      editor.setSelectedRange(selRange[0]+1,0);
    }
    else {
      editor.setSelectedText(q+sel+q);
      editor.setSelectedRange(selRange[0]+selRange[1]+2,0);
    }

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.