User tests: Successful: Unsuccessful:
If scripts have type='text/javascript' in it - it triggers a warning in html5 validation:
Warning: The type attribute is unnecessary for JavaScript resources.
In our templates we can set $doc->setHtml5(true) to remove type='text/javascript' from script.
But in the email.php its hard coded - so it doesn't seem to work.
Is there away to do this?
Pull Request for Issue # .
Remove type='text/javascript' to pass html5 validation
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
This doesn't work efficiently, that's why it is honestly better to just leave it alone for 3.x.
Unless you have a system plugin calling $doc->setHtml5(true);
very early in the process, these HTML helpers are still going to print the HTML4 compatible syntax. Your template's index.php
file is not actually executed until after components are processed but before modules are processed, so setting the mode in the template makes no difference.
This should just be closed. Yes, it generates an annoying warning in an HTML5 validator because HTML5 allows you to omit attributes where the value matches the default in some circumstances, but it is not breaking any functionality to keep it.
BTW, to properly fix this and other potential mixed HTML4/HTML5/XHTML issues so that all locations "respect" the template option, you would have to rewrite Joomla's execution cycle to allow the template to make system changes much sooner in the process. That is quite a major change just to silence a type attribute on <script>
tags.
Closing for stated reason. Thanks.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-07-04 18:05:06 |
Closed_By | ⇒ | Quy |
We shouldn't change this in J3 because non-HTML5 documents are supported. Or at least this should be conditional based on document type. Personally, I wouldn't bother with this. This doesn't causes any issues and is already fixed in J4.