Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file-types causes an error in W3C Markup Validation Service #4046

Open
2 tasks done
CookiePLMonster opened this issue Apr 26, 2024 · 0 comments
Open
2 tasks done

file-types causes an error in W3C Markup Validation Service #4046

CookiePLMonster opened this issue Apr 26, 2024 · 0 comments

Comments

@CookiePLMonster
Copy link

CookiePLMonster commented Apr 26, 2024

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for self-hosted support

Using official Plausible Cloud hosting or self-hosting?

Plausible Cloud from plausible.io

Describe the bug

As per File downloads tracking, the script can be configured to track different file types than the default list by adding a file-types attribute to <script>. However, this is not a valid attribute for that element, so the HTML validator reports an error Attribute file-types not allowed on element <script> at this point..

To verify, you may try to validate this minimal HTML file:

<!DOCTYPE html>
<head>
<script defer file-types="js,py" data-domain="yourdomain.com" src="https://plausible.io/js/script.file-downloads.js"></script>
</head>

Consider introducing a data attribute alias data-file-types (or deprecating the current one), as data attributes can be completely arbitrary.

EDIT:
I see that add-file-types also exists: https://github.com/plausible/analytics/blob/ca25b6c7649c6ab9c9268eb57c7931dca1393b94/tracker/src/customEvents.js#L89C5-L89C22 but it's completely undocumented. Could this be a good opportunity to document it too?

Expected behavior

Including Plausible's script does not result in any additional validation errors.

Screenshots

No response

Environment

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant