mirror of
https://github.com/markedjs/marked
synced 2024-11-22 17:37:24 +00:00
allow version to be a github commit
This commit is contained in:
parent
9e2c72f64a
commit
3681bcff33
@ -75,6 +75,13 @@ fetch('https://data.jsdelivr.com/v1/package/npm/marked')
|
|||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
if ('version' in search && search.version) {
|
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;
|
$markedVerElem.value = search.version;
|
||||||
} else {
|
} else {
|
||||||
$markedVerElem.value = 'master';
|
$markedVerElem.value = 'master';
|
||||||
|
Loading…
Reference in New Issue
Block a user