✪ >
Markdown quote

Script key: Markdown quote

Install

Details

Label ✪ >
Voice Over Markdown quote
Script
// Apply Markdown quote to current line

var lnRange = getSelectedLineRange();
var ln = getTextInRange(lnRange[0],lnRange[1]);
var selRange = getSelectedRange();

if (ln[0] != ">") {
  var prefix = ">";
  if (ln.length == 0 || (ln && ln[0] != " ")) {
    prefix = "> ";
  }

  setTextInRange(lnRange[0],lnRange[1],prefix+ln);
  setSelectedRange(selRange[0]+prefix.length,selRange[1]);
}

Advanced

Keyboard shortcut None
Hide key Yes

Discussion

comments powered by Disqus