diff --git a/CHANGELOG.md b/CHANGELOG.md index 948d74027..8d09668f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.10.4 +### Bug fixes +- fix execute script + ## 1.10.3 ### Bug fixes - compatible vuep QingWei-Li/vuep/issues/2 diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 8c9b608bd..2fa8efeda 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 1.10.3 +# docsify 1.10.4 > A magical documentation site generator. diff --git a/lib/docsify.js b/lib/docsify.js index 0621a5a30..0d2e66fa6 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -2604,11 +2604,11 @@ function renderArticle (content) { .filter(function (script) { return !/template/.test(script.type); } )[0]; - CACHE.vm = script && script.remove() + CACHE.vm = script ? new Function(("return " + (script.innerText.trim())))() : new Vue({ el: 'main' }); // eslint-disable-line - CACHE.vm && CACHE.vm.$nextTick(function (_) { return scrollActiveSidebar(); }); + script && script.remove(); } if (OPTIONS$1.auto2top) { setTimeout(function () { return scroll2Top(OPTIONS$1.auto2top); }, 0); } } diff --git a/lib/docsify.min.js b/lib/docsify.min.js index 4b47baa15..f6a142253 100644 --- a/lib/docsify.min.js +++ b/lib/docsify.min.js @@ -1,2 +1,2 @@ -var Docsify=function(){"use strict";function e(e,t,n){void 0===t&&(t="GET");var r=new XMLHttpRequest;return r.open(t,e),r.send(),{then:function(e,t){if(void 0===t&&(t=function(){}),n){var a=setInterval(function(e){return n({step:Math.floor(5*Math.random()+1)})},500);r.addEventListener("progress",n),r.addEventListener("loadend",function(e){n(e),clearInterval(a)})}r.addEventListener("error",t),r.addEventListener("load",function(n){var r=n.target;r.status>=400?t(r):e(r.response)})},abort:function(){return 4!==r.readyState&&r.abort()}}}function t(e,t){var n=[],r={};return e.forEach(function(e){var a=e.level||1,i=a-1;a>t||(r[i]?(r[i].children=r[i].children||[],r[i].children.push(e)):n.push(e),r[a]=e)}),n}function n(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function r(e){return null===e||void 0===e}function a(){var e=window.location;if(q===e.hash&&!r(A))return A;var t=e.hash.match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,A=t,q=e.hash,t}function i(){return document.body.clientWidth<=600}function s(e){var t=/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g,n=!1,r="-";if(s.occurrences=s.occurrences||{},"string"!=typeof e)return"";n||(e=e.toLowerCase());var a=e.trim().replace(/<[^>\d]+>/g,"").replace(t,"").replace(/\s/g,r).replace(/-+/g,r).replace(/^(\d)/,"_$1"),i=s.occurrences[a];return s.occurrences.hasOwnProperty(a)?i++:i=0,s.occurrences[a]=i,i&&(a=a+"-"+i),a}function o(e){return e.replace(/:(\w*?):/gi,'$1').replace(/__colon__/g,":")}function l(){function e(){for(var e,i=document.body.scrollTop,o=0,c=n.length;oi){e||(e=u);break}e=u}if(e){var p=s[e.getAttribute("data-id")];if(p&&p!==l&&(l&&l.classList.remove("active"),p.classList.add("active"),l=p,!t&&!g.noSticky)){var d=0,h=l.offsetTop+l.clientHeight+40,f=l.offsetTop>=r.scrollTop&&h<=r.scrollTop+a,m=h-d=e||g.dom.classList.contains("hidden")?(document.body.classList.add("sticky"),g.noSticky=!1):(document.body.classList.remove("sticky"),g.noSticky=!0)}()}function h(e,t){return t={exports:{}},e(t,t.exports),t.exports}function f(e){return e?(/\/\//.test(e)||(e="https://github.com/"+e),e=e.replace(/^git\+/,""),'\n \n \n '):""}function m(e){var t=e+'';return(i()?t+"
":"
"+t)+'
\n
\n
\n
'}function b(){var e=", 100%, 85%",t="linear-gradient(to left bottom, hsl("+(Math.floor(255*Math.random())+e)+") 0%, hsl("+(Math.floor(255*Math.random())+e)+") 100%)";return'
\n
\n
\n
'}function v(){return''}function y(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+='
  • '+e.title+"
  • ",e.children&&(t+='
    • '+y(e.children)+"
    ")}),t):""}function k(e,t){return'

    '+t.slice(5).trim()+"

    "}function w(e){P=e;var t=new M.Renderer;t.heading=function(e,t){var n=s(e),r="";return P.router&&(r="#/"+a()),F.push({level:t,slug:r+"#"+encodeURIComponent(n),title:e}),"'+e+""},t.code=function(e,t){void 0===t&&(t="");var n=N.highlight(e,N.languages[t]||N.languages.markup);return'
    '+n.replace(/:/g,"__colon__")+"
    "},t.link=function(e,t,n){return P.router&&!/:/.test(e)&&(e=("#/"+e).replace(/\/\//g,"/")),''+n+""},t.paragraph=function(e){return/^!>/.test(e)?k("tip",e):/^\?>/.test(e)?k("warn",e):"

    "+e+"

    "},"function"==typeof P.markdown?(I.setOptions({renderer:t}),I=P.markdown.call(this,I)):I.setOptions(j({renderer:t},P.markdown));var n=I;I=function(e){return o(n(e))}}function x(e,t){var n=document.querySelector("nav")||document.createElement("nav");P.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=f(P.repo)+(P.coverpage?b():"")+m(P.sidebarToggle?v():""),document.body.insertBefore(n,document.body.children[0]),p("button.sidebar-toggle"),P.coverpage?!i()&&window.addEventListener("scroll",g):document.body.classList.add("sticky")}function L(e){if(z("article",e?I(e):"not found"),P.sidebar||P.loadSidebar||_(),e&&"undefined"!=typeof Vue){W.vm&&W.vm.$destroy();var t=[].slice.call(document.body.querySelectorAll("article>script")).filter(function(e){return!/template/.test(e.type)})[0];W.vm=t&&t.remove()?new Function("return "+t.innerText.trim())():new Vue({el:"main"}),W.vm&&W.vm.$nextTick(function(e){return l()})}P.auto2top&&setTimeout(function(){return d(P.auto2top)},0)}function S(e){W.navbar&&W.navbar===e||(W.navbar=e,e&&z("nav",I(e)),u("nav"))}function _(e){var n;e?(n=I(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0]):n=P.sidebar?y(P.sidebar,"