[build] 4.8.6
This commit is contained in:
parent
f69b8af91a
commit
a97c61d8e5
4 changed files with 75 additions and 0 deletions
|
|
@ -3335,7 +3335,11 @@ function getAndRemoveConfig(str) {
|
|||
str = str
|
||||
.replace(/^'/, '')
|
||||
.replace(/'$/, '')
|
||||
<<<<<<< HEAD
|
||||
.replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, function (m, key, value) {
|
||||
=======
|
||||
.replace(/:([\w-]+)=?([\w-]+)?/g, function (m, key, value) {
|
||||
>>>>>>> [build] 4.8.6
|
||||
config[key] = (value && value.replace(/"/g, '')) || true;
|
||||
return ''
|
||||
})
|
||||
|
|
@ -3483,7 +3487,10 @@ Compiler.prototype.compileEmbed = function compileEmbed (href, title) {
|
|||
embed = compileMedia[type].call(this, href, title);
|
||||
embed.type = type;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
embed.fragment = config.fragment;
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
|
||||
return embed
|
||||
}
|
||||
|
|
@ -3634,6 +3641,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
|||
|
||||
return ("<img src=\"" + url + "\"data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">")
|
||||
};
|
||||
<<<<<<< HEAD
|
||||
origin.list = renderer.list = function (body, ordered, start) {
|
||||
var isTaskList = /<li class="task-list-item">/.test(body.split('class="task-list"')[0]);
|
||||
var isStartReq = start && start > 1;
|
||||
|
|
@ -3651,6 +3659,8 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
|||
|
||||
return html
|
||||
};
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
|
||||
renderer.origin = origin;
|
||||
|
||||
|
|
@ -3726,9 +3736,12 @@ function btn(el) {
|
|||
var toggle = function (_) { return body.classList.toggle('close'); };
|
||||
|
||||
el = getNode(el);
|
||||
<<<<<<< HEAD
|
||||
if (el == null) {
|
||||
return
|
||||
}
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
on(el, 'click', function (e) {
|
||||
e.stopPropagation();
|
||||
toggle();
|
||||
|
|
@ -3744,9 +3757,13 @@ function btn(el) {
|
|||
|
||||
function collapse(el) {
|
||||
el = getNode(el);
|
||||
<<<<<<< HEAD
|
||||
if (el == null) {
|
||||
return
|
||||
}
|
||||
=======
|
||||
|
||||
>>>>>>> [build] 4.8.6
|
||||
on(el, 'click', function (ref) {
|
||||
var target = ref.target;
|
||||
|
||||
|
|
@ -3784,10 +3801,15 @@ function sticky() {
|
|||
*/
|
||||
function getAndActive(router, el, isParent, autoTitle) {
|
||||
el = getNode(el);
|
||||
<<<<<<< HEAD
|
||||
var links = [];
|
||||
if (el != null) {
|
||||
links = findAll(el, 'a');
|
||||
}
|
||||
=======
|
||||
|
||||
var links = findAll(el, 'a');
|
||||
>>>>>>> [build] 4.8.6
|
||||
var hash = decodeURI(router.toURL(router.getCurrentPath()));
|
||||
var target;
|
||||
|
||||
|
|
@ -3990,10 +4012,14 @@ function scrollActiveSidebar(router) {
|
|||
coverHeight = cover ? cover.offsetHeight : 0;
|
||||
|
||||
var sidebar = getNode('.sidebar');
|
||||
<<<<<<< HEAD
|
||||
var lis = [];
|
||||
if (sidebar != null) {
|
||||
lis = findAll(sidebar, 'li');
|
||||
}
|
||||
=======
|
||||
var lis = findAll(sidebar, 'li');
|
||||
>>>>>>> [build] 4.8.6
|
||||
|
||||
for (var i = 0, len = lis.length; i < len; i += 1) {
|
||||
var li = lis[i];
|
||||
|
|
@ -4077,11 +4103,14 @@ function walkFetchEmbed(ref, cb) {
|
|||
if (token.embed.type === 'markdown') {
|
||||
embedToken = compile.lexer(text);
|
||||
} else if (token.embed.type === 'code') {
|
||||
<<<<<<< HEAD
|
||||
if (token.embed.fragment) {
|
||||
var fragment = token.embed.fragment;
|
||||
var pattern = new RegExp(("(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]"));
|
||||
text = ((text.match(pattern) || [])[1] || '').trim();
|
||||
}
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
embedToken = compile.lexer(
|
||||
'```' +
|
||||
token.embed.lang +
|
||||
|
|
@ -5046,7 +5075,15 @@ function initGlobalAPI () {
|
|||
dom: dom,
|
||||
get: get,
|
||||
slugify: slugify,
|
||||
<<<<<<< HEAD
|
||||
version: '4.9.1'
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
version: '4.9.0'
|
||||
=======
|
||||
version: '4.8.6'
|
||||
>>>>>>> [build] 4.8.6
|
||||
>>>>>>> [build] 4.8.6
|
||||
};
|
||||
window.DocsifyCompiler = Compiler;
|
||||
window.marked = marked;
|
||||
|
|
|
|||
8
lib/docsify.min.js
vendored
8
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,7 @@
|
|||
(function () {
|
||||
var INDEXS = {};
|
||||
|
||||
<<<<<<< HEAD
|
||||
var LOCAL_STORAGE = {
|
||||
EXPIRE_KEY: 'docsify.search.expires',
|
||||
INDEX_KEY: 'docsify.search.index'
|
||||
|
|
@ -13,6 +14,8 @@ function resolveIndexKey(namespace) {
|
|||
return namespace ? ((LOCAL_STORAGE.INDEX_KEY) + "/" + namespace) : LOCAL_STORAGE.INDEX_KEY
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
function escapeHtml(string) {
|
||||
var entityMap = {
|
||||
'&': '&',
|
||||
|
|
@ -46,9 +49,15 @@ function getAllPaths(router) {
|
|||
return paths
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
function saveData(maxAge, expireKey, indexKey) {
|
||||
localStorage.setItem(expireKey, Date.now() + maxAge);
|
||||
localStorage.setItem(indexKey, JSON.stringify(INDEXS));
|
||||
=======
|
||||
function saveData(maxAge) {
|
||||
localStorage.setItem('docsify.search.expires', Date.now() + maxAge);
|
||||
localStorage.setItem('docsify.search.index', JSON.stringify(INDEXS));
|
||||
>>>>>>> [build] 4.8.6
|
||||
}
|
||||
|
||||
function genIndex(path, content, router, depth) {
|
||||
|
|
@ -166,6 +175,7 @@ function search(query) {
|
|||
|
||||
function init$1(config, vm) {
|
||||
var isAuto = config.paths === 'auto';
|
||||
<<<<<<< HEAD
|
||||
|
||||
var expireKey = resolveExpireKey(config.namespace);
|
||||
var indexKey = resolveIndexKey(config.namespace);
|
||||
|
|
@ -173,6 +183,11 @@ function init$1(config, vm) {
|
|||
var isExpired = localStorage.getItem(expireKey) < Date.now();
|
||||
|
||||
INDEXS = JSON.parse(localStorage.getItem(indexKey));
|
||||
=======
|
||||
var isExpired = localStorage.getItem('docsify.search.expires') < Date.now();
|
||||
|
||||
INDEXS = JSON.parse(localStorage.getItem('docsify.search.index'));
|
||||
>>>>>>> [build] 4.8.6
|
||||
|
||||
if (isExpired) {
|
||||
INDEXS = {};
|
||||
|
|
@ -193,7 +208,11 @@ function init$1(config, vm) {
|
|||
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
|
||||
.then(function (result) {
|
||||
INDEXS[path] = genIndex(path, result, vm.router, config.depth);
|
||||
<<<<<<< HEAD
|
||||
len === ++count && saveData(config.maxAge, expireKey, indexKey);
|
||||
=======
|
||||
len === ++count && saveData(config.maxAge);
|
||||
>>>>>>> [build] 4.8.6
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -327,8 +346,12 @@ var CONFIG = {
|
|||
paths: 'auto',
|
||||
depth: 2,
|
||||
maxAge: 86400000, // 1 day
|
||||
<<<<<<< HEAD
|
||||
hideOtherSidebarContent: false,
|
||||
namespace: undefined
|
||||
=======
|
||||
hideOtherSidebarContent: false
|
||||
>>>>>>> [build] 4.8.6
|
||||
};
|
||||
|
||||
var install = function (hook, vm) {
|
||||
|
|
@ -344,7 +367,10 @@ var install = function (hook, vm) {
|
|||
CONFIG.noData = opts.noData || CONFIG.noData;
|
||||
CONFIG.depth = opts.depth || CONFIG.depth;
|
||||
CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent;
|
||||
<<<<<<< HEAD
|
||||
CONFIG.namespace = opts.namespace || CONFIG.namespace;
|
||||
=======
|
||||
>>>>>>> [build] 4.8.6
|
||||
}
|
||||
|
||||
var isAuto = CONFIG.paths === 'auto';
|
||||
|
|
|
|||
4
lib/plugins/search.min.js
vendored
4
lib/plugins/search.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue