bump 1.9.0

This commit is contained in:
qingwei.li 2017-01-24 22:31:27 +08:00
parent 0709239c77
commit 98d1b19bea
7 changed files with 21 additions and 12 deletions

View File

@ -1,3 +1,4 @@
## 1.9.0
### Bug fixes
- Destroys the vue instance when the route is changed

View File

@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>1.8.0</small>
# docsify <small>1.9.0</small>
> A magical documentation site generator.

View File

@ -2463,11 +2463,14 @@ function tree (toc, tpl) {
return tpl
}
function helper (className, content) {
return ("<p class=\"" + className + "\">" + (content.slice(5).trim()) + "</p>")
}
var OPTIONS$1 = {};
var markdown = marked;
var toc = [];
var CACHE = {};
var TIP_RE = /^!\s/;
var renderTo = function (dom, content) {
dom = typeof dom === 'object' ? dom : document.querySelector(dom);
@ -2517,8 +2520,12 @@ function init (options) {
return ("<a href=\"" + href + "\" title=\"" + (title || '') + "\">" + text + "</a>")
};
renderer.paragraph = function (text) {
var isTip = TIP_RE.test(text);
return isTip ? ("<p class=\"tip\">" + (text.replace(TIP_RE, '')) + "</p>") : ("<p>" + text + "</p>")
if (/^!&gt;/.test(text)) {
return helper('tip', text)
} else if (/^\?&gt;/.test(text)) {
return helper('warn', text)
}
return ("<p>" + text + "</p>")
};
if (typeof OPTIONS$1.markdown === 'function') {
@ -2561,12 +2568,13 @@ function renderArticle (content) {
if (content && typeof Vue !== 'undefined') {
var script = content.match('<script[^>]*?>([^<]+)</script>');
script && document.body.querySelector('article script').remove();
var vm = script
script && document.body.querySelector('article script').remove();
CACHE.vm && CACHE.vm.$destroy();
CACHE.vm = script
? new Function(("return " + (script[1].trim())))()
: new Vue({ el: 'main' }); // eslint-disable-line
vm && vm.$nextTick(function (_) { return scrollActiveSidebar(); });
CACHE.vm && CACHE.vm.$nextTick(function (_) { return scrollActiveSidebar(); });
}
if (OPTIONS$1.auto2top) { setTimeout(function () { return scroll2Top(OPTIONS$1.auto2top); }, 0); }
}

4
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long