Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit 9110ea4

Browse files
committed
Added search for author
1 parent 4bb5757 commit 9110ea4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/snippet-injector.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ export default {
193193
listitems.push({
194194
title: elem.getTitle(),
195195
uid: elem.getUID(),
196-
tags: elem.getTags()
196+
tags: elem.getTags(),
197+
author: elem.getAuthor()
197198
});
198199
icons.push(elem.getLang());
199200
});

lib/util.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,11 @@ export default class Util {
144144
if(text !== '' && text !== ' ' && text !== null && text !== undefined) {
145145
var title = element.title.toLowerCase();
146146
var tags = element.tags.join(' ').toLowerCase();
147+
var author = element.author.toLowerCase();
147148
if(text.startsWith('#')) {
148149
return (tags.indexOf(text.split('#').join('')) > -1 ? true : false);
150+
} else if(text.startsWith('@')) {
151+
return (author.indexOf(text.split('@').join('')) > -1 ? true : false);
149152
} else {
150153
return (title.indexOf(text) > -1 ? true : false);
151154
}

0 commit comments

Comments
 (0)