Skip to content

Commit f1272a2

Browse files
committed
[build] 4.3.13
1 parent 1b91227 commit f1272a2

11 files changed

Lines changed: 21 additions & 13 deletions

File tree

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.3.12</small>
3+
# docsify <small>4.3.13</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3990,7 +3990,7 @@ initGlobalAPI();
39903990
/**
39913991
* Version
39923992
*/
3993-
Docsify.version = '4.3.12';
3993+
Docsify.version = '4.3.13';
39943994

39953995
/**
39963996
* Run Docsify

lib/docsify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/plugins/search.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,22 @@ function genIndex (path, content, router, depth) {
7070
return index
7171
}
7272

73-
function search (keywords) {
73+
/**
74+
* @param {String} query
75+
* @returns {Array}
76+
*/
77+
function search (query) {
7478
var matchingResults = [];
7579
var data = [];
7680
Object.keys(INDEXS).forEach(function (key) {
7781
data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return INDEXS[key][page]; }));
7882
});
7983

80-
keywords = [].concat(keywords, keywords.trim().split(/[\s\-\,\\/]+/));
84+
query = query.trim();
85+
var keywords = query.split(/[\s\-\,\\/]+/);
86+
if (keywords.length !== 1) {
87+
keywords = [].concat(query, keywords);
88+
}
8189

8290
var loop = function ( i ) {
8391
var post = data[i];
@@ -202,7 +210,7 @@ function doSearch (value) {
202210

203211
var html = '';
204212
matchs.forEach(function (post) {
205-
html += "<div class=\"matching-post\">\n<h2><a href=\"" + (post.url) + "\">" + (post.title) + "</a></h2>\n<p>" + (post.content) + "</p>\n</div>";
213+
html += "<div class=\"matching-post\">\n<a href=\"" + (post.url) + "\"> \n<h2>" + (post.title) + "</h2>\n<p>" + (post.content) + "</p>\n</a>\n</div>";
206214
});
207215

208216
$panel.classList.add('show');

lib/plugins/search.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)