[build] 4.5.8
This commit is contained in:
parent
368754ebd9
commit
0e479613bc
9 changed files with 52 additions and 23 deletions
|
|
@ -1,6 +1,6 @@
|
||||||

|

|
||||||
|
|
||||||
# docsify <small>4.5.7</small>
|
# docsify <small>4.5.8</small>
|
||||||
|
|
||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -612,10 +612,6 @@ block.list = replace(block.list)
|
||||||
('def', '\\n+(?=' + block.def.source + ')')
|
('def', '\\n+(?=' + block.def.source + ')')
|
||||||
();
|
();
|
||||||
|
|
||||||
block.blockquote = replace(block.blockquote)
|
|
||||||
('def', block.def)
|
|
||||||
();
|
|
||||||
|
|
||||||
block._tag = '(?!(?:'
|
block._tag = '(?!(?:'
|
||||||
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
|
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
|
||||||
+ '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
|
+ '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
|
||||||
|
|
@ -1032,7 +1028,7 @@ var inline = {
|
||||||
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
|
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
|
||||||
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
|
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
|
||||||
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
|
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
|
||||||
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
|
code: /^(`+)([\s\S]*?[^`])\1(?!`)/,
|
||||||
br: /^ {2,}\n(?!\s*$)/,
|
br: /^ {2,}\n(?!\s*$)/,
|
||||||
del: noop,
|
del: noop,
|
||||||
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
|
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
|
||||||
|
|
@ -1155,9 +1151,11 @@ InlineLexer.prototype.output = function(src) {
|
||||||
if (cap = this$1.rules.autolink.exec(src)) {
|
if (cap = this$1.rules.autolink.exec(src)) {
|
||||||
src = src.substring(cap[0].length);
|
src = src.substring(cap[0].length);
|
||||||
if (cap[2] === '@') {
|
if (cap[2] === '@') {
|
||||||
text = cap[1].charAt(6) === ':'
|
text = escape(
|
||||||
|
cap[1].charAt(6) === ':'
|
||||||
? this$1.mangle(cap[1].substring(7))
|
? this$1.mangle(cap[1].substring(7))
|
||||||
: this$1.mangle(cap[1]);
|
: this$1.mangle(cap[1])
|
||||||
|
);
|
||||||
href = this$1.mangle('mailto:') + text;
|
href = this$1.mangle('mailto:') + text;
|
||||||
} else {
|
} else {
|
||||||
text = escape(cap[1]);
|
text = escape(cap[1]);
|
||||||
|
|
@ -1238,7 +1236,7 @@ InlineLexer.prototype.output = function(src) {
|
||||||
// code
|
// code
|
||||||
if (cap = this$1.rules.code.exec(src)) {
|
if (cap = this$1.rules.code.exec(src)) {
|
||||||
src = src.substring(cap[0].length);
|
src = src.substring(cap[0].length);
|
||||||
out += this$1.renderer.codespan(escape(cap[2], true));
|
out += this$1.renderer.codespan(escape(cap[2].trim(), true));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1452,10 +1450,13 @@ Renderer.prototype.link = function(href, title, text) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
|
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.options.baseUrl && !originIndependentUrl.test(href)) {
|
||||||
|
href = resolveUrl(this.options.baseUrl, href);
|
||||||
|
}
|
||||||
var out = '<a href="' + href + '"';
|
var out = '<a href="' + href + '"';
|
||||||
if (title) {
|
if (title) {
|
||||||
out += ' title="' + title + '"';
|
out += ' title="' + title + '"';
|
||||||
|
|
@ -1465,6 +1466,9 @@ Renderer.prototype.link = function(href, title, text) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Renderer.prototype.image = function(href, title, text) {
|
Renderer.prototype.image = function(href, title, text) {
|
||||||
|
if (this.options.baseUrl && !originIndependentUrl.test(href)) {
|
||||||
|
href = resolveUrl(this.options.baseUrl, href);
|
||||||
|
}
|
||||||
var out = '<img src="' + href + '" alt="' + text + '"';
|
var out = '<img src="' + href + '" alt="' + text + '"';
|
||||||
if (title) {
|
if (title) {
|
||||||
out += ' title="' + title + '"';
|
out += ' title="' + title + '"';
|
||||||
|
|
@ -1677,8 +1681,8 @@ function escape(html, encode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unescape(html) {
|
function unescape(html) {
|
||||||
// explicitly match decimal, hex, and named HTML entities
|
// explicitly match decimal, hex, and named HTML entities
|
||||||
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
|
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) {
|
||||||
n = n.toLowerCase();
|
n = n.toLowerCase();
|
||||||
if (n === 'colon') { return ':'; }
|
if (n === 'colon') { return ':'; }
|
||||||
if (n.charAt(0) === '#') {
|
if (n.charAt(0) === '#') {
|
||||||
|
|
@ -1702,6 +1706,30 @@ function replace(regex, opt) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resolveUrl(base, href) {
|
||||||
|
if (!baseUrls[' ' + base]) {
|
||||||
|
// we can ignore everything in base after the last slash of its path component,
|
||||||
|
// but we might need to add _that_
|
||||||
|
// https://tools.ietf.org/html/rfc3986#section-3
|
||||||
|
if (/^[^:]+:\/*[^/]*$/.test(base)) {
|
||||||
|
baseUrls[' ' + base] = base + '/';
|
||||||
|
} else {
|
||||||
|
baseUrls[' ' + base] = base.replace(/[^/]*$/, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
base = baseUrls[' ' + base];
|
||||||
|
|
||||||
|
if (href.slice(0, 2) === '//') {
|
||||||
|
return base.replace(/:[^]*/, ':') + href;
|
||||||
|
} else if (href.charAt(0) === '/') {
|
||||||
|
return base.replace(/(:\/*[^/]*)[^]*/, '$1') + href;
|
||||||
|
} else {
|
||||||
|
return base + href;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
baseUrls = {};
|
||||||
|
originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
|
||||||
|
|
||||||
function noop() {}
|
function noop() {}
|
||||||
noop.exec = noop;
|
noop.exec = noop;
|
||||||
|
|
||||||
|
|
@ -1838,7 +1866,8 @@ marked.defaults = {
|
||||||
smartypants: false,
|
smartypants: false,
|
||||||
headerPrefix: '',
|
headerPrefix: '',
|
||||||
renderer: new Renderer,
|
renderer: new Renderer,
|
||||||
xhtml: false
|
xhtml: false,
|
||||||
|
baseUrl: null
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3101,7 +3130,7 @@ function getAndActive (router, el, isParent, autoTitle) {
|
||||||
el = getNode(el);
|
el = getNode(el);
|
||||||
|
|
||||||
var links = findAll(el, 'a');
|
var links = findAll(el, 'a');
|
||||||
var hash = router.toURL(router.getCurrentPath());
|
var hash = decodeURI(router.toURL(router.getCurrentPath()));
|
||||||
var target;
|
var target;
|
||||||
|
|
||||||
links.sort(function (a, b) { return b.href.length - a.href.length; }).forEach(function (a) {
|
links.sort(function (a, b) { return b.href.length - a.href.length; }).forEach(function (a) {
|
||||||
|
|
@ -4063,7 +4092,7 @@ initGlobalAPI();
|
||||||
/**
|
/**
|
||||||
* Version
|
* Version
|
||||||
*/
|
*/
|
||||||
Docsify.version = '4.5.7';
|
Docsify.version = '4.5.8';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run Docsify
|
* Run Docsify
|
||||||
|
|
|
||||||
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
File diff suppressed because one or more lines are too long
|
|
@ -37,5 +37,5 @@
|
||||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "4.5.7"
|
"version": "4.5.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docsify-server-renderer",
|
"name": "docsify-server-renderer",
|
||||||
"version": "4.5.7",
|
"version": "4.5.8",
|
||||||
"description": "docsify server renderer",
|
"description": "docsify server renderer",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue