diff --git a/CHANGELOG.md b/CHANGELOG.md index 0499ca02f..52f5074a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -## 1.7.1 +## 1.7.3 +### Bug fixes +- Add `hr` style +- Fixed option is an empty string + +## 1.7.2 ### Bug fixes - Fix sidebar click event in mobile browser. diff --git a/docs/_coverpage.md b/docs/_coverpage.md index a0ef8d4a7..72401a920 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 1.7.2 +# docsify 1.7.3 > A magical documentation site generator. diff --git a/lib/docsify.js b/lib/docsify.js index ba23e899e..fa49d6c20 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -2703,7 +2703,7 @@ var script = document.currentScript || [].slice.call(document.getElementsByTagNa if (script) { for (var prop in OPTIONS) { var val = script.getAttribute('data-' + camel2kebab(prop)); - OPTIONS[prop] = isNil(val) ? OPTIONS[prop] : (val || true); + OPTIONS[prop] = isNil(val) ? OPTIONS[prop] : (typeof OPTIONS[prop] === 'string' ? val : true); } if (OPTIONS.loadSidebar === true) { OPTIONS.loadSidebar = '_sidebar.md'; } if (OPTIONS.loadNavbar === true) { OPTIONS.loadNavbar = '_navbar.md'; } diff --git a/lib/docsify.min.js b/lib/docsify.min.js index 5370a425c..41aa7f34a 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(E===e.hash&&!r($))return $;var t=e.hash.match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,$=t,E=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(){function e(){for(var e,r=document.body.scrollTop,i=0,s=n.length;ir){e||(e=l);break}e=l}if(e){var u=a[e.getAttribute("data-id")];u&&u!==o&&(o&&o.classList.remove("active"),u.classList.add("active"),o=u,!t&&!d.noSticky&&o.scrollIntoView(!1))}}if(!i()){for(var t=!1,n=document.querySelectorAll(".anchor"),r=document.querySelector("aside.sidebar"),a={},s=r.querySelectorAll("li"),o=r.querySelector("li.active"),l=0,u=s.length;l=e||d.dom.classList.contains("hidden")?(document.body.classList.add("sticky"),d.noSticky=!1):(document.body.classList.remove("sticky"),d.noSticky=!0)}()}function g(e,t){return t={exports:{}},e(t,t.exports),t.exports}function h(e){return e?(/\/\//.test(e)||(e="https://github.com/"+e),e=e.replace(/^git\+/,""),'\n \n \n '):""}function f(e){var t=e+'';return(i()?t+"
":"
"+t)+'
\n
\n
\n
'}function m(){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 b(){return''}function v(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+='
  • '+e.title+"
  • ",e.children&&(t+='
    • '+v(e.children)+"
    ")}),t):""}function y(e){M=e;var t=new j.Renderer;t.heading=function(e,t){var n=s(e),r="";return M.router&&(r="#/"+a()),P.push({level:t,slug:r+"#"+encodeURIComponent(n),title:e}),"'+e+""},t.code=function(e,t){void 0===t&&(t="");var n=O.highlight(e,O.languages[t]||O.languages.markup).replace(/{{/g,"{{");return'
    '+n+"
    "},t.link=function(e,t,n){return M.router&&!/:/.test(e)&&(e=("#/"+e).replace(/\/\//g,"/")),''+n+""},t.paragraph=function(e){var t=F.test(e);return t?'

    '+e.replace(F,"")+"

    ":"

    "+e+"

    "},"function"==typeof M.markdown?(N.setOptions({renderer:t}),N=M.markdown.call(this,N)):N.setOptions(q({renderer:t},M.markdown))}function k(e,t){var n=document.querySelector("nav")||document.createElement("nav");M.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=h(M.repo)+(M.coverpage?m():"")+f(M.sidebarToggle?b():""),document.body.insertBefore(n,document.body.children[0]),c("button.sidebar-toggle"),M.coverpage?!i()&&window.addEventListener("scroll",d):document.body.classList.add("sticky")}function w(e){if(W("article",e?N(e):"not found"),M.sidebar||M.loadSidebar||L(),e&&"undefined"!=typeof Vue&&"undefined"!=typeof Vuep){var t=new Vue({el:"main"});t.$nextTick(function(e){return o()})}M.auto2top&&setTimeout(function(){return p(M.auto2top)},0)}function x(e){I.navbar&&I.navbar===e||(I.navbar=e,e&&W("nav",N(e)),u("nav"))}function L(e){var n;e?(n=N(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0]):n=M.sidebar?v(M.sidebar,"