Closed kledung closed 5 years ago
Hi, I think this is hard coded at the moment for all script tags, should be quite easy to add another config option to toggle this attribute. We can make it "opt-in" to maintain compatibility but all new installs of CDF would have this config option set to true so the attribute is not output, but upgrades would retain the attribute unless they add the config option.
I'll see what I can do, but if you want to give it a try and submit a PR that would be even better :)
Excellent stuff @Shazwazza Could you please add similar functionality for "charset" attribute as w3c warns that both attributes are obsolete.
Kind regards
CDF doesn't add any charset attribute to any html tags, so all good :)
Oh my I'm (facepalm) so sorry I had too many git-hub tabs open. Sorry this is an angular cli question. Please Ignore.
This is now merged in and fixed, there's a new config switch htmlCompatibility
which by default is html4
for compatibility reasons, but can be changed to html5
to achieve this, see here for an example: https://github.com/Shazwazza/ClientDependency/blob/master/ClientDependency.Web.Test/Web.config#L29
I know this is a slightly older post but I'm on v7.10.5 and just trying to put this fix in place after basically copying and pasting from your example config file but my Umbraco instance isn't liking it.
error: Unrecognized attribute 'htmlCompatibility'. Note that attribute names are case-sensitive
I've updated the client dependency config file -
@StuartPaterson you'll need to update to use the latest CDF version, 7.10.x very likely ships with an older versin.
Hi! I wan't to remove the type attribute (type="text/javascript") from the script tag since it's unnecessary and gives me a validation warning in W3C validator (https://validator.w3.org). How can I do this? I have tried but not managed to accomplish this. I'm using the Html.RequiresJs in my razor view like this: @{Html.RequiresJs("/static/js/custom.js");}
Warning: The type attribute is unnecessary for JavaScript resources.
Best regards Kristian