diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2020-12-30 23:55:43 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2020-12-30 23:58:35 +0200 |
commit | bfdf95ec0fce2baf7690d61a023dc65f48c5536e (patch) | |
tree | e8cf8487e9ae60a5a6466c1415e6ed3b864eb1b2 | |
parent | 98f737bfdc149f268d710612e3c3e254dbfe7cbe (diff) | |
download | shared-mime-info-work/scop/linguist-xml-magic.tar.gz |
text/vnd.trolltech.linguist: require XML whitespace or closing > in magicwork/scop/linguist-xml-magic
https://doc.qt.io/qt-5/linguist-ts-file-format.html
Avoids some more MPEG TS confusion. Hopefully that is -- I haven't
been able to locate MPEG TS samples that would be misdetected as
linguist files in the first place. But because of that, I think it's
fair to assume that the sequence `<TS` is not that common in them, and
thus it followed by XML whitespace or the start tag closing `>` could
be even less common.
Not checking for `<TS/` as the root element may not be empty per the
DTD.
Refs https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/10
-rw-r--r-- | data/freedesktop.org.xml.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in index 18ee9399..8ff5ee33 100644 --- a/data/freedesktop.org.xml.in +++ b/data/freedesktop.org.xml.in @@ -2856,7 +2856,11 @@ command to generate the output files. <comment>message catalog</comment> <sub-class-of type="application/xml"/> <magic> - <match type="string" value="<TS" offset="0:256"/> + <match type="string" value="<TS " offset="0:256"/> + <match type="string" value="<TS\t" offset="0:256"/> + <match type="string" value="<TS\r" offset="0:256"/> + <match type="string" value="<TS\n" offset="0:256"/> + <match type="string" value="<TS>" offset="0:256"/> </magic> <glob pattern="*.ts"/> <alias type="application/x-linguist"/> |