meta: Error if we can't parse dates because Date::Parse is missing

You can still use [[!meta name="date" content="..."]] to generate
<meta> tags that are not interpreted, but the common case for
[[!meta date="..."]] is that you want to change the ctime, and that
won't work without Date::Parse.

Signed-off-by: Simon McVittie <smcv@debian.org>
master
Simon McVittie 2018-03-21 09:02:21 +00:00
parent 88c66d3758
commit 10dc1fa7b2
1 changed files with 6 additions and 0 deletions

View File

@ -162,6 +162,9 @@ sub preprocess (@) {
error(sprintf(gettext('cannot parse date/time: %s'), $value)); error(sprintf(gettext('cannot parse date/time: %s'), $value));
} }
} }
else {
error $@;
}
} }
elsif ($key eq 'updated') { elsif ($key eq 'updated') {
eval q{use Date::Parse}; eval q{use Date::Parse};
@ -174,6 +177,9 @@ sub preprocess (@) {
error(sprintf(gettext('cannot parse date/time: %s'), $value)); error(sprintf(gettext('cannot parse date/time: %s'), $value));
} }
} }
else {
error $@;
}
} }
if (! defined wantarray) { if (! defined wantarray) {