X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/d238fd1b04b41b17cc9cb444d6dcee498d6a14c5..fc7119505840b4156c5a13f1dab0cafbf3af2700:/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn?ds=sidebyside diff --git a/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn b/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn index c55b3f62d..c451ac4a5 100644 --- a/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn +++ b/doc/bugs/html5_time_element__39__s_pubdate_wrong_when_using_xhtml5___34__mode__34__.mdwn @@ -6,35 +6,57 @@ XML error: The pubdate REQUIRES a date, so e.g. `pubdate="2009-03-24T18:02:14Z"` +> No, `pubdate="pubdate"`. It's a boolean attribute. applied && [[done]] +> --[[Joey]] +>> awesome, thanks for fixing my fix ;) --[[simonraven]] +>>> This seems to be happening either still or again with version 3.20200202.3-1. I'm getting strings generated like +>>> +>>> Posted <time datetime="2007-12-06T05:00:00Z" pubdate="pubdate">Thu 06 Dec 2007 12:00:00 AM EST</time> +>>> +>>> which shows up as an error on https://validator.w3.org/ --Luke Schierer + +>>>> My reading of Joey's response, above, was that (according to the spec at the time), `pubdate="pubdate"` is what +>>>> should be generated, *not* `pubdate="timestamp"`, and so what you are seeing is expected. However, looking at +>>>> the *current* Spec (linked elsewhere in this page), `pubdate` is not actually a valid attribute any more at +>>>> all. And indeed, running my own blog through the Validator, I see: +>>>>> `Error: Attribute pubdate not allowed on element time at this point.` +>>>> *— [[Jon]], 2020-10-05* + +>>>>> I've filed a separate bug page for this, since this one is already +>>>>> marked *done*: [[bugs/pubdate_not_valid_for_html5]]. I've filed a +>>>>> patch. *—[[Jon]], 2020-10-06* + Otherwise the XML parser chokes. +(indented exactly 4 spaces) +
-diff --git a/IkiWiki.pm b/IkiWiki.pm
-index 1f2ab07..6ab5b56 100644
---- a/IkiWiki.pm
-+++ b/IkiWiki.pm
-@@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
-    my $time=formattime($_[0], $_[1]);
-    if ($config{html5}) {
-        return '';
-    }
-    else {
-diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm
-index fe8ef09..8c4a1b4 100644
---- a/IkiWiki/Plugin/relativedate.pm
-+++ b/IkiWiki/Plugin/relativedate.pm
-@@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) {
- 
-    if ($config{html5}) {
-        return '';
-    }
-    else {
-        return '';
+    diff --git a/IkiWiki.pm b/IkiWiki.pm
+    index 1f2ab07..6ab5b56 100644
+    --- a/IkiWiki.pm
+    +++ b/IkiWiki.pm
+    @@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
+        my $time=formattime($_[0], $_[1]);
+        if ($config{html5}) {
+            return '<time datetime="'.date_3339($_[0]).'"'.
+    -         ($_[2] ? ' pubdate' : '').
+    +           ($_[2] ? ' pubdate="'.date_3339($_[0]).'"' : '').
+                '>'.$time.'</time>';
+        }
+        else {
+    diff --git a/IkiWiki/Plugin/relativedate.pm b/IkiWiki/Plugin/relativedate.pm
+    index fe8ef09..8c4a1b4 100644
+    --- a/IkiWiki/Plugin/relativedate.pm
+    +++ b/IkiWiki/Plugin/relativedate.pm
+    @@ -59,7 +59,7 @@ sub mydisplaytime ($;$$) {
+     
+        if ($config{html5}) {
+            return '<time datetime="'.IkiWiki::date_3339($time).'"'.
+    -         ($pubdate ? ' pubdate' : '').$mid.'</time>';
+    +           ($pubdate ? ' pubdate="'.IkiWiki::date_3339($time).'"' : '').$mid.'</time>';
+        }
+        else {
+            return '<span'.$mid.'</span>';