Skip to content

Commit 363607f

Browse files
committed
Tags actually fixed. Now correctly getting regex capture group
1 parent f45de0f commit 363607f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

OpenNote/openNote/services/tagService.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ openNote.service("tagService", function ($rootScope,storageService) {
88
this.bindHandlers = function(){
99
$rootScope.$on("noteSaved", function(event, note) {
1010
deleteTagsFromMap(note._id,function(){
11-
var results = note.note.match(tagRegex);
12-
if(!results||!results.length)
11+
var matches;
12+
var output = [];
13+
while ((matches = tagRegex.exec(note.note)))
14+
output.push(matches[1]);
15+
16+
if(!output.length)
1317
return;
14-
addTagsToMap(results,note._id);
18+
addTagsToMap(output,note._id);
1519
});
1620
});
1721

0 commit comments

Comments
 (0)