mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
bump 1.8.0
This commit is contained in:
parent
2af035ff45
commit
9d096b03a4
@ -1,4 +1,4 @@
|
||||
## xxx
|
||||
## 1.8.0
|
||||
### Bug fixes
|
||||
- Using `v-pre` skip compilation.
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>1.7.5</small>
|
||||
# docsify <small>1.8.0</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
@ -2505,10 +2505,9 @@ function init (options) {
|
||||
renderer.code = function (code, lang) {
|
||||
if ( lang === void 0 ) lang = '';
|
||||
|
||||
var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup)
|
||||
.replace(/{{/g, '<span>{{</span>');
|
||||
var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup);
|
||||
|
||||
return ("<pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + hl + "</code></pre>")
|
||||
return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + hl + "</code></pre>")
|
||||
};
|
||||
renderer.link = function (href, title, text) {
|
||||
if (OPTIONS$1.router && !/:/.test(href)) {
|
||||
@ -2560,9 +2559,14 @@ function renderArticle (content) {
|
||||
renderTo('article', content ? markdown(content) : 'not found');
|
||||
if (!OPTIONS$1.sidebar && !OPTIONS$1.loadSidebar) { renderSidebar(); }
|
||||
|
||||
if (content && typeof Vue !== 'undefined' && typeof Vuep !== 'undefined') {
|
||||
var vm = new Vue({ el: 'main' }); // eslint-disable-line
|
||||
vm.$nextTick(function (_) { return scrollActiveSidebar(); });
|
||||
if (content && typeof Vue !== 'undefined') {
|
||||
var script = content.match('<script[^>]*?>([^<]+)</script>');
|
||||
script && document.body.querySelector('article script').remove();
|
||||
|
||||
var vm = script
|
||||
? new Function(("return " + (script[1].trim())))()
|
||||
: new Vue({ el: 'main' }); // eslint-disable-line
|
||||
vm && vm.$nextTick(function (_) { return scrollActiveSidebar(); });
|
||||
}
|
||||
if (OPTIONS$1.auto2top) { setTimeout(function () { return scroll2Top(OPTIONS$1.auto2top); }, 0); }
|
||||
}
|
||||
@ -2757,11 +2761,10 @@ var mainRender = function (cb) {
|
||||
if (OPTIONS.coverpage && page !== OPTIONS.homepage) { renderCover(); }
|
||||
// render sidebar
|
||||
if (OPTIONS.loadSidebar) {
|
||||
load(basePath + OPTIONS.loadSidebar)
|
||||
.then(function (result) {
|
||||
renderSidebar(result);
|
||||
cb();
|
||||
});
|
||||
var renderSidebar$$1 = function (result) { renderSidebar(result); cb(); };
|
||||
|
||||
load(basePath + OPTIONS.loadSidebar).then(renderSidebar$$1,
|
||||
function (_) { return load(OPTIONS.loadSidebar).then(renderSidebar$$1); });
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
@ -2769,7 +2772,8 @@ var mainRender = function (cb) {
|
||||
|
||||
// Render navbar
|
||||
if (OPTIONS.loadNavbar) {
|
||||
load(basePath + OPTIONS.loadNavbar).then(renderNavbar);
|
||||
load(basePath + OPTIONS.loadNavbar).then(renderNavbar,
|
||||
function (_) { return load(OPTIONS.loadNavbar).then(renderNavbar); });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
4
lib/docsify.min.js
vendored
4
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user