W3C validation is failing due to Cloudflare producing bad html

Cloudflare unfortunately modifies tags with an invalid type tag.

Here is my original html :

<script src="js/myscript.js" type="text/javascript"></script>

Cloudflare, however, makes this into something like:

<script src="js/myscript.js" type="6e0e156949dd8b1694614bc1-text/javascript"></script>

The problem is that 6e0e156949dd8b1694614bc1-text/javascript is not a valid value for the type field. It should just be text/javascript as in the original html. In turn, W3C validation fails with an error:

Error: A script element with a src attribute must not have a type attribute whose value is anything other than the empty string, a JavaScript MIME type, or module.

I suggest that Cloudflare modifies the scripts to something like instead to confirm to W3C validation:

<script src="js/myscript.js" type="text/javascript" data-cf-someid="6e0e156949dd8b1694614bc1"></script>

Original post here: W3C validation fails due to CF - Developers - Cloudflare Community - but I did not receive a notification when posting / and the answer there suggest to disable Rocket loader - which is hardly the answer I am looking for.

2 posts were merged into an existing topic: W3C validation fails due to CF