Action Directory / ESV Text(表格粘贴)

Install

Searches for the selected Scripture reference on ESV.org and returns the passage formatted in Markdown.

Script

url = "http://www.esvapi.org/v2/rest/passageQuery?key=IP&passage=";
url += editor.getSelectedText().replace(/ /, "+");
url += "&output-format=plain-text";
url += "&include-headings=false&include-footnotes=false&include-passage-horizontal-lines=false&include-heading-horizontal-lines=false&include-content-type=false&line-length=0";
http.get(url, function(data, err) {
    if(err) { ui.alert(err); } else {
        text = data.replace(/\[([0123456789:]+)\]/g, "^$1 ");
        editor.replaceSelection(text);
    }
});