]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/bugs/charset_attribute_on_the_script_element_is_obsolete.mdwn
another example error i get
[git.ikiwiki.info.git] / doc / bugs / charset_attribute_on_the_script_element_is_obsolete.mdwn
1 the w3 validator fails on the main ikiwiki website because of the way inline scripts are handled. For example, [validating](https://validator.w3.org/nu/?doc=https%3A%2F%2Fikiwiki.info%2Fforum%2Fconvention_for_signing_posts_to_ikiwiki.info%2F) the post [[forum/convention_for_signing_posts_to_ikiwiki.info]] leads to this warning:
3 [[!format txt """
4 Warning: The charset attribute on the script element is obsolete.
6 From line 271, column 1; to line 271, column 78
8 >↩↩</div>↩<script src="../../ikiwiki/ikiwiki.js" type="text/javascript" charset="utf-8"></scri
9 """]]
11 Seems like a low-hanging fruit... 
13 There are other errors on my blog, namely the `pubdate=pubdate` blob added by `IkiWiki::displaytime`, no idea where that's coming from, but it's not standard anymore. See for example, [this validation](https://validator.w3.org/nu/?doc=https%3A%2F%2Fanarc.at%2Fblog%2F2020-04-27-drowning-camera%2F) and also the [time element specification](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-time-element). It looks like it was [part of HTML5](https://www.w3.org/TR/2011/WD-html5-author-20110809/the-time-element.html#attr-time-pubdate) but was removed at some later point. According to [this GitHub comment on the react project](https://github.com/facebook/react/issues/3411#issuecomment-80234574), it was replaced by the [itemprop](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemprop) attribute, as in `itemprop="datePublished"`. See also [this w3 example](https://html.spec.whatwg.org/multipage/sections.html#the-article-element:the-article-element-11). Phew.
15 -- [[anarcat]] 2022-09-01