Skip to content

Conversation

ggerhard
Copy link
Contributor

@ggerhard ggerhard commented Oct 5, 2020

Proposed bugfixes for Issues #10 and #11 :

#10 : Keywords at the end of a string will be cut off if they are not followed by a SPLIT_CHAR.
Quick fix: added EOL as alternative

#11 : Matches inside of other matches (e.g. strings) will be appended as duplicate substring at the end of the original match
Proposed fix: filter/remove nested matches

Copy link
Owner

@scriptcoded scriptcoded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting your improvements! I haven't had a lot of time to fix these issues.

I looked through your code, and your solutions look solid. Would you mind removing semicolons (my bad for not having a styleguide/linter) before I merge your changes?

index.js Outdated
Comment on lines 72 to 75
if (sortedMatches[i].start >= upperBound) {
filteredMatches.push(sortedMatches[i]);
upperBound = sortedMatches[i].start + sortedMatches[i].length;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There also seems to be some indentation issues here. I'll make sure to get a linter set up asap...

@ggerhard
Copy link
Contributor Author

ggerhard commented Oct 6, 2020

Glad to be of help! I removed the semicolons (Java habit ;)) and improved the indentation, I hope it's ok now.

@scriptcoded
Copy link
Owner

Thank you for the fixes, and happy Hacktober! 🎉

@scriptcoded scriptcoded merged commit e5fee51 into scriptcoded:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants