Skip to content

Commit

Permalink
Only remove unwanted character at the beginning of a string (#51). (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mt40 authored Mar 18, 2017
1 parent 1f2733f commit 88a5a2b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.8.8
- Fix a bug where asterisk(*) and slash(/) are removed even if they are in the middle of a string.

## 1.8.7
- Add support for Matlab.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-todo-parser",
"displayName": "TODO Parser",
"description": "Parse TODOs in your working files.",
"version": "1.8.7",
"version": "1.8.8",
"publisher": "minhthai",
"engines": {
"vscode": "^1.2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/classes/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export class Parser {
*/
private static cleanString(str: string): string {
let no_space = str.trim();
let no_leading_slash = no_space.replace(/\/+/, '');
let no_leading_asterisk = no_leading_slash.replace(/\*+/g, '');
no_leading_asterisk = no_leading_asterisk.replace(/\/+/, ''); // remove slash again!
let no_leading_slash = no_space.replace(/^\/+/, '');
let no_leading_asterisk = no_leading_slash.replace(/^\*+/g, '');
no_leading_asterisk = no_leading_asterisk.replace(/^\/+/, ''); // remove slash again!
str = no_leading_asterisk.trim();
return str;
}
Expand Down
1 change: 1 addition & 0 deletions test/samples/spaced path/cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using namespace std;

int main() {
//TODO: cpp one line
// TODO scale axis to get metres/feet
/* Todo: cpp multiline
* todo
*/
Expand Down

0 comments on commit 88a5a2b

Please sign in to comment.