Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 oftomorrow
. 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.