allow version to be a github commit

This commit is contained in:
Tony Brix 2019-02-13 18:24:44 -06:00
parent 9e2c72f64a
commit 3681bcff33

View File

@ -75,6 +75,13 @@ fetch('https://data.jsdelivr.com/v1/package/npm/marked')
})
.then(function () {
if ('version' in search && search.version) {
if (!(search.version in markedVersions)) {
markedVersions[search.version] = 'https://cdn.jsdelivr.net/gh/markedjs/marked@' + search.version + '/lib/marked.js';
var opt = document.createElement('option');
opt.textContent = search.version.substring(0, 7);
opt.value = search.version;
$markedVerElem.insertBefore(opt, $markedVerElem.firstChild);
}
$markedVerElem.value = search.version;
} else {
$markedVerElem.value = 'master';