bump 1.9.0
This commit is contained in:
parent
0709239c77
commit
98d1b19bea
7 changed files with 21 additions and 12 deletions
|
|
@ -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 (/^!>/.test(text)) {
|
||||
return helper('tip', text)
|
||||
} else if (/^\?>/.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); }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue