diff --git a/CHANGELOG.md b/CHANGELOG.md index 36b7750b9..76f6013bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### 2.4.3 + +> 2017-02-15 + +#### Bug fixes +* fix emoji replacing error (#76) + ### 2.4.2 > 2017-02-14 diff --git a/README.md b/README.md index 88937d14b..dd7de59b9 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ ## Features - Not build static html files -- Simple and lightweight (~13kB gzipped) +- Simple and lightweight (~14kB gzipped) - Smart full-text search plugin - Multiple themes - Useful plugin API diff --git a/docs/README.md b/docs/README.md index 31602abe3..529c54be3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,7 +11,7 @@ See the [Quick start](/quickstart) for more details. ## Features - Not build static html files -- Simple and lightweight (~13kB gzipped) +- Simple and lightweight (~14kB gzipped) - Smart full-text search plugin - Multiple themes - Useful plugin API diff --git a/docs/_coverpage.md b/docs/_coverpage.md index f17d956d3..d0f7bbfd1 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,10 +1,10 @@ ![logo](_media/icon.svg) -# docsify 2.4.2 +# docsify 2.4.3 > A magical documentation site generator. -- Simple and lightweight (~13kB gzipped) +- Simple and lightweight (~14kB gzipped) - Not build static html files - Multiple themes diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md index 00035eb42..e5051b1c9 100644 --- a/docs/zh-cn/README.md +++ b/docs/zh-cn/README.md @@ -12,8 +12,8 @@ docsify 是一个动态生成文档网站的工具。不同于 GitBook、Hexo ## 特性 - 无需构建,写完文档直接发布 -- 容易使用并且轻量 (~13Kb gzipped) -- 智能的全文检索 +- 容易使用并且轻量 (~14kB gzipped) +- 智能的全文搜索 - 提供多套主题 - 丰富的 API - 兼容 IE9+ diff --git a/docs/zh-cn/configuration.md b/docs/zh-cn/configuration.md index c79db818e..23c96d49c 100644 --- a/docs/zh-cn/configuration.md +++ b/docs/zh-cn/configuration.md @@ -108,7 +108,7 @@ window.$docsify = { - 类型:`Number` - 默认值: `0` -自定义侧边栏后默认不会再生成目录,你也可以通过设置生成目录的最大层级开启这个功能, +自定义侧边栏后默认不会再生成目录,你也可以通过设置生成目录的最大层级开启这个功能。 ```js diff --git a/docs/zh-cn/plugins.md b/docs/zh-cn/plugins.md index 9fd249b79..8145f016e 100644 --- a/docs/zh-cn/plugins.md +++ b/docs/zh-cn/plugins.md @@ -2,9 +2,9 @@ ## 内置插件 -### 全文检索 - Search +### 全文搜索 - Search -全文检索插件会根据当前页面上的超链接获取文档内容,在 `localStorage` 内建立文档索引。默认过期时间为一天,当然我们可以自己指定需要缓存的文件列表或者配置过期时间。 +全文搜索插件会根据当前页面上的超链接获取文档内容,在 `localStorage` 内建立文档索引。默认过期时间为一天,当然我们可以自己指定需要缓存的文件列表或者配置过期时间。 ```html diff --git a/lib/docsify.js b/lib/docsify.js index 5515dc49a..518bafb80 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -171,7 +171,7 @@ var merge = Object.assign || function (to) { function emojify (text) { return text .replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, function (match) { return match.replace(/:/g, '__colon__'); }) - .replace(/:(\w*?):/ig, '$1') + .replace(/:(\w+?):/ig, '$1') .replace(/__colon__/g, ':') } diff --git a/lib/docsify.min.js b/lib/docsify.min.js index 109b2cd05..15d2f5a5d 100644 --- a/lib/docsify.min.js +++ b/lib/docsify.min.js @@ -1,2 +1,2 @@ -var D=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 i=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(i)})}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 i=e.level||1,o=i-1;i>t||(r[o]?(r[o].children=r[o].children||[],r[o].children.push(e)):n.push(e),r[i]=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 i(){var e=window.location;if(M===e.hash&&!r(j))return j;var t=e.hash.replace(/%23/g,"#").match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,j=t,M=e.hash,t}function o(){return document.body.clientWidth<=600}function a(e){var t=/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g,n=!1,r="-";if(a.occurrences=a.occurrences||{},"string"!=typeof e)return"";n||(e=e.toLowerCase());var i=e.trim().replace(/<[^>\d]+>/g,"").replace(t,"").replace(/\s/g,r).replace(/-+/g,r).replace(/^(\d)/,"_$1"),o=a.occurrences[i];return a.occurrences.hasOwnProperty(i)?o++:o=0,a.occurrences[i]=o,o&&(i=i+"-"+o),i}function s(e){return e.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w*?):/gi,'$1').replace(/__colon__/g,":")}function l(){function e(){for(var e,o=document.body.scrollTop,l=0,u=n.length;lo){e||(e=d);break}e=d}if(e){var p=s[e.getAttribute("data-id")];if(p&&p!==c&&(c&&c.classList.remove("active"),p.classList.add("active"),c=p,!t&&!h.noSticky)){var g=0,f=c.offsetTop+c.clientHeight+40,m=c.offsetTop>=i.scrollTop&&f<=i.scrollTop+a,y=f-g=e||h.dom.classList.contains("hidden")?(document.body.classList.add("sticky"),h.noSticky=!1):(document.body.classList.remove("sticky"),h.noSticky=!0)}()}function g(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(){var e=b()+'';return(o()?e+"
":"
"+e)+'
\n
\n
\n
'}function y(){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 k(e,t){return'

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

    "}function w(e){return""}function x(e){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,$docsify.themeColor)}function L(){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--foo: red)"))){var t=document.querySelectorAll("style:not(.inserted),link");[].forEach.call(t,function(t){if("STYLE"===t.nodeName)x(t);else if("LINK"===t.nodeName){var n=t.getAttribute("href");if(!/\.css$/.test(n))return;e(n).then(function(e){var t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t),x(t)})}})}}function S(){var e=new F.Renderer;e.heading=function(e,t){var n=a(e),r="";return r="#/"+i(),D.push({level:t,slug:r+"#"+encodeURIComponent(n),title:e}),"'+e+""},e.code=function(e,t){void 0===t&&(t="");var n=W.highlight(e,W.languages[t]||W.languages.markup);return'
    '+n+"
    "},e.link=function(e,t,n){return/:|(\/{2})/.test(e)||(e=("#/"+e).replace(/\/+/g,"/")),''+n+""},e.paragraph=function(e){return/^!>/.test(e)?k("tip",e):/^\?>/.test(e)?k("warn",e):"

    "+e+"

    "},e.image=function(e,t,n){var r=/:|(\/{2})/.test(e)?e:($docsify.basePath+e).replace(/\/+/g,"/"),i=t?' title="'+t+'"':"";return''+n+'"},"function"==typeof $docsify.markdown?z=$docsify.markdown.call(this,z,e):($docsify.markdown&&$docsify.markdown.renderer&&($docsify.markdown.renderer=O(e,$docsify.markdown.renderer)),z.setOptions(O({renderer:e},$docsify.markdown)));var t=z;z=function(e){return s(t(e))},window.Docsify.utils.marked=function(e){var t=z(e);return D=[],t}}function $(e,t){var n=document.querySelector("nav")||document.createElement("nav"),r=document.body,i=document.head;if($docsify.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=f($docsify.repo)+($docsify.coverpage?y():"")+m(),r.insertBefore(n,r.children[0]),$docsify.themeColor&&(i.innerHTML+=w($docsify.themeColor),L()),$docsify.name){var a=document.querySelector(".sidebar");a.innerHTML='

    '+$docsify.name+"

    "+a.innerHTML}d("button.sidebar-toggle"),$docsify.coverpage?!o()&&window.addEventListener("scroll",h):r.classList.add("sticky")}function _(e){var t=window.Docsify.hook,n=function(e){if(G("article",e),$docsify.loadSidebar||E(),e&&"undefined"!=typeof Vue){R.vm&&R.vm.$destroy();var t=[].slice.call(document.body.querySelectorAll("article>script")).filter(function(e){return!/template/.test(e.type)})[0],n=t?t.innerText.trim():null;t&&t.remove(),R.vm=n?new Function("return "+n)():new Vue({el:"main"}),R.vm&&R.vm.$nextTick(function(e){return l()})}$docsify.auto2top&&setTimeout(function(){return p($docsify.auto2top)},0)};t.emit("before",e,function(e){var r=e?z(e):"";t.emit("after",r,function(e){return n(e||"not found")})})}function C(e){R.navbar&&R.navbar===e||(R.navbar=e,e&&G("nav",z(e)),u("nav"))}function E(e){var n;e?(n=z(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0]):n=v(t(D,$docsify.maxLevel),"