Skip to content
19 changes: 19 additions & 0 deletions src/plugins/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ function doSearch(value) {

let html = '';
matchs.forEach(post => {
if (/<!-- {docsify-ignore} -->/g.test(post.title)) {
post.title = post.title.replace('<!-- {docsify-ignore} -->', '');
}

if (/{docsify-ignore}/g.test(post.title)) {
post.title = post.title.replace('{docsify-ignore}', '');
}

if (/<!-- {docsify-ignore-all} -->/g.test(post.title)) {
post.title = post.title.replace(
'<!-- {docsify-ignore-all} -->',
''
);
}

if (/{docsify-ignore-all}/g.test(post.title)) {
post.title = post.title.replace('{docsify-ignore-all}', '');
}

html += `<div class="matching-post">
<a href="${post.url}">
<h2>${post.title}</h2>
Expand Down