Skip to content

Commit d5194b4

Browse files
committed
[build] 4.4.1
1 parent fa772cf commit d5194b4

File tree

11 files changed

+65
-316
lines changed

11 files changed

+65
-316
lines changed

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/icon.svg)
22

3-
# docsify <small>4.4.0</small>
3+
# docsify <small>4.4.1</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,6 +2794,22 @@ var cleanPath = cached(function (path) {
27942794
});
27952795

27962796
var cachedLinks = {};
2797+
function getAndRemoveConfig (str) {
2798+
if ( str === void 0 ) str = '';
2799+
2800+
var config = {};
2801+
2802+
if (str) {
2803+
str = str
2804+
.replace(/:([\w-]+)=?([\w-]+)?/g, function (m, key, value) {
2805+
config[key] = value || true;
2806+
return ''
2807+
})
2808+
.trim();
2809+
}
2810+
2811+
return { str: str, config: config }
2812+
}
27972813

27982814
var Compiler = function Compiler (config, router) {
27992815
this.config = config;
@@ -2894,16 +2910,11 @@ Compiler.prototype._initRenderer = function _initRenderer () {
28942910
if ( title === void 0 ) title = '';
28952911

28962912
var attrs = '';
2897-
var config = {};
28982913

2899-
if (title) {
2900-
title = title
2901-
.replace(/:(\w+)=?(\w+)?/g, function (m, key, value) {
2902-
config[key] = value || true;
2903-
return ''
2904-
})
2905-
.trim();
2906-
}
2914+
var ref = getAndRemoveConfig(title);
2915+
var str = ref.str;
2916+
var config = ref.config;
2917+
title = str;
29072918

29082919
if (
29092920
!/:|(\/{2})/.test(href) &&
@@ -2925,9 +2936,10 @@ Compiler.prototype._initRenderer = function _initRenderer () {
29252936
}
29262937

29272938
if (title) {
2928-
title = " title=\"" + title + "\"";
2939+
attrs += " title=\"" + title + "\"";
29292940
}
2930-
return ("<a href=\"" + href + "\"" + (title || '') + attrs + ">" + text + "</a>")
2941+
2942+
return ("<a href=\"" + href + "\"" + attrs + ">" + text + "</a>")
29312943
};
29322944
origin.paragraph = renderer.paragraph = function (text) {
29332945
if (/^!&gt;/.test(text)) {
@@ -2939,13 +2951,26 @@ Compiler.prototype._initRenderer = function _initRenderer () {
29392951
};
29402952
origin.image = renderer.image = function (href, title, text) {
29412953
var url = href;
2942-
var titleHTML = title ? (" title=\"" + title + "\"") : '';
2954+
var attrs = '';
2955+
2956+
var ref = getAndRemoveConfig(title);
2957+
var str = ref.str;
2958+
var config = ref.config;
2959+
title = str;
2960+
2961+
if (config['no-zoom']) {
2962+
attrs += ' data-no-zoom';
2963+
}
2964+
2965+
if (title) {
2966+
attrs += " title=\"" + title + "\"";
2967+
}
29432968

29442969
if (!isAbsolutePath(href)) {
29452970
url = getPath(contentBase, href);
29462971
}
29472972

2948-
return ("<img src=\"" + url + "\" data-origin=\"" + href + "\" alt=\"" + text + "\"" + titleHTML + ">")
2973+
return ("<img src=\"" + url + "\"data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">")
29492974
};
29502975

29512976
renderer.origin = origin;
@@ -2985,11 +3010,12 @@ Compiler.prototype.subSidebar = function subSidebar (level) {
29853010
var cacheTree = ref.cacheTree;
29863011
var toc = ref.toc;
29873012

2988-
toc[0] && toc[0].ignoreAllSubs && (this.toc = []);
3013+
toc[0] && toc[0].ignoreAllSubs && toc.splice(0);
29893014
toc[0] && toc[0].level === 1 && toc.shift();
2990-
toc.forEach(function (node, i) {
2991-
node.ignoreSubHeading && toc.splice(i, 1);
2992-
});
3015+
3016+
for (var i = 0; i < toc.length; i++) {
3017+
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--;
3018+
}
29933019

29943020
var tree$$1 = cacheTree[currentPath] || genTree(toc, level);
29953021

@@ -4010,7 +4036,7 @@ initGlobalAPI();
40104036
/**
40114037
* Version
40124038
*/
4013-
Docsify.version = '4.4.0';
4039+
Docsify.version = '4.4.1';
40144040

40154041
/**
40164042
* Run Docsify

lib/docsify.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)