From 3681bcff33d6e3237acd70aa14098be3889fa228 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 13 Feb 2019 18:24:44 -0600 Subject: [PATCH] allow version to be a github commit --- docs/demo/demo.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 279b7374..f8ce4657 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -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';