If you wrap string in the proper tags you will get the same result, but
with different offset (28 chars):
tee "index.html" <<eol ; echo -e "\n"; kmimetypefinder5 index.html
<!DOCTYPE html>
<html><body>`printf "x"%.0s {1..228}`
use strict
</body></html>
eol # -> text/html
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to shared-mime-info in Ubuntu.
https://bugs.launchpad.net/bugs/1890716
Title:
misidentifies .html file as Perl script when it contains JavaScript
"use strict"
Status in shared-mime-info:
Unknown
Status in kde-cli-tools package in Ubuntu:
New
Status in shared-mime-info package in Ubuntu:
Fix Committed
Status in shared-mime-info package in Debian:
Confirmed
Bug description:
For .html files `xdg-mime` reports wrong type. The culprit is the
`"use strict"` phrase which is used in JavaScript. It should not
mistake .html files for anything else except of text/html !
STEPS TO REPRODUCE:
Run the following step by step in any folder:
1. $ echo "\"use strict\"" > index.html
2. $ xdg-mime query filetype index.html # -> application/x-perl - this should
be text/html!
Platform:
Ubuntu 20.04.1 LTS (Focal Fossa)"
Linux version 5.4.0-42-generic (buildd@lgw01-amd64-038) (gcc version 9.3.0
(Ubuntu 9.3.0-10ubuntu2))
xdg-utils: 1.1.3-2ubuntu1
To manage notifications about this bug go to:
https://bugs.launchpad.net/shared-mime-info/+bug/1890716/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp