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

Please use individual XML files to get a good order for extensions #52

Open
rrthomas opened this issue Sep 18, 2023 · 0 comments
Open

Comments

@rrthomas
Copy link

The Shared MIME-info Database spec says:

The first glob element represents the "main" extension for the file type. While this doesn’t affect the
mimetype matching algorithm, this information can be useful when a single main extension is needed
for a mimetype, for instance so that applications can choose an appropriate extension when saving a
file.

This is useful information. In particular, it would be good if the extensions() function returned the glob elements in the order defined in each file. The trouble is that the order is randomized in the globs file, if the weights are equal, so for example on my system the extension returned by extensions() in scalar context for applicaton/javascript is .jsm, and not the more obvious .js, which is the first in the XML file, and hence the main extension according to the spec.

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