-
Notifications
You must be signed in to change notification settings - Fork 967
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
Zola 0.19.0 doesn't accept all valid YAML dates #2538
Labels
done in pr
Already done in a PR
Comments
Can you submit the change as a PR with some additional tests? |
@Keats will do :) would you also be interested in using named regex groups instead of indexed ones? I find it more readable and more flexible |
Sure go for it |
Keats
pushed a commit
that referenced
this issue
Jun 27, 2024
* Refine YAML date regex This commit does a few changes: - Introduce a new regex - it is a bit off-spec (it allows one-digit months and days in date-only mode) - uses named groups - avoids group duplication - parses offset once Fixes #2538 * Fix nanosecond parsing * Rename variables for brewity * Add tests
reujab
pushed a commit
to reujab/zola
that referenced
this issue
Aug 14, 2024
* Refine YAML date regex This commit does a few changes: - Introduce a new regex - it is a bit off-spec (it allows one-digit months and days in date-only mode) - uses named groups - avoids group duplication - parses offset once Fixes getzola#2538 * Fix nanosecond parsing * Rename variables for brewity * Add tests
berdandy
pushed a commit
to berdandy/azola
that referenced
this issue
Sep 17, 2024
* Refine YAML date regex This commit does a few changes: - Introduce a new regex - it is a bit off-spec (it allows one-digit months and days in date-only mode) - uses named groups - avoids group duplication - parses offset once Fixes getzola#2538 * Fix nanosecond parsing * Rename variables for brewity * Add tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
With 0.19.0, Zola can now understand more date formats. However, I believe there is a bug in the implementation which makes the millisecond separator (but not the milliseconds) required
Environment
Zola version: 0.19.0
Expected Behavior
2024-06-22 18:42:00 +02:00
should be a correct datetimeCurrent Behavior
If I add a single dot after the seconds (
2024-06-22 18:42:00. +02:00
), the issue goes away.Step to reproduce
2024-06-22 18:42:00 +02:00
zola build
orzola serve
Possible solution
I believe there is an error in the regex:
https://github.com/getzola/zola/blob/v0.19.0/components/utils/src/de.rs#L12
As you can see, the millisecond (aka fraction) part of the string is optional, but the period is not. This contradicts the YAML Working Draft on Timestamp which was mentioned in the original issue.
Additional info
Same error also happens if I omit the seconds altogether (
2024-06-22 18:42 +02:00
). I may be opinionated, but I think requiring those should be optional, too.Relates to #2071, #2208
The text was updated successfully, but these errors were encountered: