]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn
bug with pubdate, in process of testing fix
[ikiwiki.git] / doc / bugs / html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn
1 Hi,
2
3 XML error:
4
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>
6
7 The pubdate REQUIRES a date, so e.g. `pubdate="2009-03-24T18:02:14Z"`
8
9 Otherwise the XML parser chokes.
10
11 <http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-pubdate>
12
13 <pre>
14 diff --git a/IkiWiki.pm b/IkiWiki.pm
15 index 1f2ab07..6ab5b56 100644
16 --- a/IkiWiki.pm
17 +++ b/IkiWiki.pm
18 @@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
19     my $time=formattime($_[0], $_[1]);
20     if ($config{html5}) {
21         return '<time datetime="'.date_3339($_[0]).'"'.
22 -         ($_[2] ? ' pubdate' : '').
23 +           ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : '').
24             '>'.$time.'</time>';
25     }
26     else {
27 diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm
28 index fe8ef09..8c4a1b4 100644
29 --- a/IkiWiki/Plugin/relativedate.pm
30 +++ b/IkiWiki/Plugin/relativedate.pm
31 @@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) {
32  
33     if ($config{html5}) {
34         return '<time datetime="'.IkiWiki::date_3339($time).'"'.
35 -         ($pubdate ? ' pubdate' : '').$mid.'</time>';
36 +           ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'</time>';
37     }
38     else {
39         return '<span'.$mid.'</span>';
40 </pre>