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