5 Created <time datetime="2009-03-24T18:02:14Z" pubdate class="relativedate" title="Tue, 24 Mar 2009 14:02:14 -0400">2009-03-24</time>
7 The pubdate REQUIRES a date, so e.g. `pubdate="2009-03-24T18:02:14Z"`
9 > No, `pubdate="pubdate"`. It's a boolean attribute. applied && [[done]]
11 >> awesome, thanks for fixing my fix ;) --[[simonraven]]
12 >>> This seems to be happening either still or again with version 3.20200202.3-1. I'm getting strings generated like
14 >>> Posted <time datetime="2007-12-06T05:00:00Z" pubdate="pubdate">Thu 06 Dec 2007 12:00:00 AM EST</time>
16 >>> which shows up as an error on https://validator.w3.org/ --Luke Schierer
18 >>>> My reading of Joey's response, above, was that (according to the spec at the time), `pubdate="pubdate"` is what
19 >>>> should be generated, *not* `pubdate="timestamp"`, and so what you are seeing is expected. However, looking at
20 >>>> the *current* Spec (linked elsewhere in this page), `pubdate` is not actually a valid attribute any more at
21 >>>> all. And indeed, running my own blog through the Validator, I see:
22 >>>>> `Error: Attribute pubdate not allowed on element time at this point.`
23 >>>> *— [[Jon]], 2020-10-05*
25 >>>>> I've filed a separate bug page for this, since this one is already
26 >>>>> marked *done*: [[bugs/pubdate_not_valid_for_html5]]. I've filed a
27 >>>>> patch. *—[[Jon]], 2020-10-06*
29 Otherwise the XML parser chokes.
31 <http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-pubdate>
33 (indented exactly 4 spaces)
36 diff --git a/IkiWiki.pm b/IkiWiki.pm
37 index 1f2ab07..6ab5b56 100644
40 @@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
41 my $time=formattime($_[0], $_[1]);
43 return '<time datetime="'.date_3339($_[0]).'"'.
44 - ($_[2] ? ' pubdate' : '').
45 + ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : '').
46 '>'.$time.'</time>';
49 diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm
50 index fe8ef09..8c4a1b4 100644
51 --- a/IkiWiki/Plugin/relativedate.pm
52 +++ b/IkiWiki/Plugin/relativedate.pm
53 @@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) {
56 return '<time datetime="'.IkiWiki::date_3339($time).'"'.
57 - ($pubdate ? ' pubdate' : '').$mid.'</time>';
58 + ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'</time>';
61 return '<span'.$mid.'</span>';