Skip to content

Commit

Permalink
allow version to be a github commit
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Feb 14, 2019
1 parent 9e2c72f commit 3681bcf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 3681bcf

Please sign in to comment.