mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-01 11:39:41 +08:00
bump 1.9.0
This commit is contained in:
parent
0709239c77
commit
98d1b19bea
@ -1,3 +1,4 @@
|
|||||||
|
## 1.9.0
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
- Destroys the vue instance when the route is changed
|
- Destroys the vue instance when the route is changed
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
![logo](_media/icon.svg)
|
![logo](_media/icon.svg)
|
||||||
|
|
||||||
# docsify <small>1.8.0</small>
|
# docsify <small>1.9.0</small>
|
||||||
|
|
||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
|
@ -2463,11 +2463,14 @@ function tree (toc, tpl) {
|
|||||||
return tpl
|
return tpl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function helper (className, content) {
|
||||||
|
return ("<p class=\"" + className + "\">" + (content.slice(5).trim()) + "</p>")
|
||||||
|
}
|
||||||
|
|
||||||
var OPTIONS$1 = {};
|
var OPTIONS$1 = {};
|
||||||
var markdown = marked;
|
var markdown = marked;
|
||||||
var toc = [];
|
var toc = [];
|
||||||
var CACHE = {};
|
var CACHE = {};
|
||||||
var TIP_RE = /^!\s/;
|
|
||||||
|
|
||||||
var renderTo = function (dom, content) {
|
var renderTo = function (dom, content) {
|
||||||
dom = typeof dom === 'object' ? dom : document.querySelector(dom);
|
dom = typeof dom === 'object' ? dom : document.querySelector(dom);
|
||||||
@ -2517,8 +2520,12 @@ function init (options) {
|
|||||||
return ("<a href=\"" + href + "\" title=\"" + (title || '') + "\">" + text + "</a>")
|
return ("<a href=\"" + href + "\" title=\"" + (title || '') + "\">" + text + "</a>")
|
||||||
};
|
};
|
||||||
renderer.paragraph = function (text) {
|
renderer.paragraph = function (text) {
|
||||||
var isTip = TIP_RE.test(text);
|
if (/^!>/.test(text)) {
|
||||||
return isTip ? ("<p class=\"tip\">" + (text.replace(TIP_RE, '')) + "</p>") : ("<p>" + text + "</p>")
|
return helper('tip', text)
|
||||||
|
} else if (/^\?>/.test(text)) {
|
||||||
|
return helper('warn', text)
|
||||||
|
}
|
||||||
|
return ("<p>" + text + "</p>")
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof OPTIONS$1.markdown === 'function') {
|
if (typeof OPTIONS$1.markdown === 'function') {
|
||||||
@ -2561,12 +2568,13 @@ function renderArticle (content) {
|
|||||||
|
|
||||||
if (content && typeof Vue !== 'undefined') {
|
if (content && typeof Vue !== 'undefined') {
|
||||||
var script = content.match('<script[^>]*?>([^<]+)</script>');
|
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 Function(("return " + (script[1].trim())))()
|
||||||
: new Vue({ el: 'main' }); // eslint-disable-line
|
: 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); }
|
if (OPTIONS$1.auto2top) { setTimeout(function () { return scroll2Top(OPTIONS$1.auto2top); }, 0); }
|
||||||
}
|
}
|
||||||
|
4
lib/docsify.min.js
vendored
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
Loading…
Reference in New Issue
Block a user