✪ `
Markdown Code

Script key: Markdown Code

Posted by Andres Rosado

Install

Details

Label ✪ `
Voice Over Markdown Code
Script
// Apply Markdown code to selection, or insert ` if no selection

var sel = getSelectedText();
var selRange = getSelectedRange();

if (!sel || sel.length == 0) {
  setSelectedText("`");
  setSelectedRange(selRange[0]+2,0);
}
else {
  setSelectedText("`"+sel+"`");
  setSelectedRange(selRange[0]+selRange[1]+4,0);
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus