]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn
Merge branch 'debian-testing'
[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 > No, `pubdate="pubdate"`. It's a boolean attribute. applied && [[done]]
10 > --[[Joey]] 
11 >> awesome, thanks for fixing my fix ;) --[[simonraven]]
12
13 Otherwise the XML parser chokes.
14
15 <http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#attr-time-pubdate>
16
17 (indented exactly 4 spaces)
18
19 <pre>
20     diff --git a/IkiWiki.pm b/IkiWiki.pm
21     index 1f2ab07..6ab5b56 100644
22     --- a/IkiWiki.pm
23     +++ b/IkiWiki.pm
24     @@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
25         my $time=formattime($_[0], $_[1]);
26         if ($config{html5}) {
27             return '&lt;time datetime="'.date_3339($_[0]).'"'.
28     -         ($_[2] ? ' pubdate' : '').
29     +           ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : '').
30                 '>'.$time.'&lt;/time&gt;';
31         }
32         else {
33     diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm
34     index fe8ef09..8c4a1b4 100644
35     --- a/IkiWiki/Plugin/relativedate.pm
36     +++ b/IkiWiki/Plugin/relativedate.pm
37     @@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) {
38      
39         if ($config{html5}) {
40             return '&lt;time datetime="'.IkiWiki::date_3339($time).'"'.
41     -         ($pubdate ? ' pubdate' : '').$mid.'&lt;/time&gt;';
42     +           ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'&lt;/time&gt;';
43         }
44         else {
45             return '&lt;span'.$mid.'&lt;/span&gt;';
46 </pre>