Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #201: Fix fuzzy date behavior #203

Closed
wants to merge 1 commit into from

Conversation

shanrauf
Copy link

@shanrauf shanrauf commented May 9, 2021

Fixes #201

All existing behavior works the same, except now fuzzy dates are only replaced when using the proper syntax with no spaces between the guards.

This PR actually solves another problem which I ran into along the way, which is that if the guards exist in the block before you type out the fuzzy date syntax, the fuzzy date won't function properly due to the regex.

Example:
I want to do x; I plan to do it ;tomorrow;

This wouldn't work because the regex picks up ; I plan to do it ; instead of tomorrow. Per my knowledge of regex, there is no magical regex solution to get all of the "substrings" (i.e "; I plan to do it ;" AND ";tomorrow;"), so I generate every substring and loop over them to check for a fuzzy date, making sure the format is valid too (i.e no spaces or other words - JUST the fuzzy date).

So this PR makes it to where you can actually use a ;fuzzy_date; wherever regardless of how many instances of the guard already exists in the block.

Lmk if you have questions.

@sonarcloud
Copy link

sonarcloud bot commented May 9, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@shanrauf shanrauf closed this Dec 7, 2023
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.

Fuzzy Dates Edge Case when using multiple semicolons in a paragraph
1 participant