Skip to content

Commit 807f921

Browse files
authored
Issue/52 (#56)
* Fix incorrectly accept markers in the middle of a string (#52). * Add built packages.
1 parent 88a5a2b commit 807f921

6 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.8.9
2+
- Fix issue 52: marker must be at the beginning of a string.
3+
14
## 1.8.8
25
- Fix a bug where asterisk(*) and slash(/) are removed even if they are in the middle of a string.
36

1020 KB
Binary file not shown.
1020 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-todo-parser",
33
"displayName": "TODO Parser",
44
"description": "Parse TODOs in your working files.",
5-
"version": "1.8.8",
5+
"version": "1.8.9",
66
"publisher": "minhthai",
77
"engines": {
88
"vscode": "^1.2.0"

src/utils/stringUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function startsWithOne(str: string, prefixes: string[]): boolean {
6868
p = '\\b' + p;
6969
if (/\w/.test(p.slice(-1)))
7070
p = p + '\\b';
71-
if ((new RegExp(p, 'i')).test(str))
71+
if ((new RegExp('^' + p, 'i')).test(str))
7272
return true;
7373
}
7474
return false;

test/samples/cpp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ int main() {
88
* todo
99
*/
1010
// NOTE: new marker
11+
// Here, we look for strings containing TODO
1112
return 0;
1213
}

0 commit comments

Comments
 (0)