summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-01-07 15:49:16 +0100
committerBastien Nocera <hadess@hadess.net>2016-01-07 15:49:16 +0100
commit4961dc3e48d13c0c675ad7c135419b864813ca55 (patch)
tree7b25b91e9d51e67fecacd9e54979985dd2fce355
parent6e5818deb54fdfa70f5798fc1df1d5c3eaba42df (diff)
downloadshared-mime-info-4961dc3e48d13c0c675ad7c135419b864813ca55.tar.gz
Add magic for XHTML files
-rw-r--r--freedesktop.org.xml.in6
-rw-r--r--tests/list3
-rw-r--r--tests/test.xht14
3 files changed, 22 insertions, 1 deletions
diff --git a/freedesktop.org.xml.in b/freedesktop.org.xml.in
index 48696d92..9ea2f95c 100644
--- a/freedesktop.org.xml.in
+++ b/freedesktop.org.xml.in
@@ -3670,6 +3670,12 @@ command to generate the output files.
<generic-icon name="text-html"/>
<glob pattern="*.xhtml"/>
<glob pattern="*.xht"/>
+ <magic priority="60">
+ <match type="string" value="//W3C//DTD XHTML " offset="0:256"/>
+ <match type="string" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" offset="0:256"/>
+ <match type="string" value="&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml" offset="0:256"/>
+ <match type="string" value="&lt;HTML xmlns=&quot;http://www.w3.org/1999/xhtml" offset="0:256"/>
+ </magic>
<root-XML namespaceURI='http://www.w3.org/1999/xhtml' localName='html'/>
</mime-type>
<mime-type type="application/zip">
diff --git a/tests/list b/tests/list
index 6973ccec..d84b800c 100644
--- a/tests/list
+++ b/tests/list
@@ -72,7 +72,8 @@ mypaint.ora image/openraster
# Copied from https://bugs.freedesktop.org/show_bug.cgi?id=19201#c4
# test.bflng application/xml x
# Copied from https://bugs.freedesktop.org/show_bug.cgi?id=19201#c3
-# test.xhtml application/xhtml+xml
+test.xhtml application/xhtml+xml
+test.xht application/xhtml+xml
# Copied from http://cvs.fedoraproject.org/viewvc/comps/comps-f11.xml.in?revision=1.306
test.xml.in application/xml x
# Copied from http://bugs.freedesktop.org/show_bug.cgi?id=25581
diff --git a/tests/test.xht b/tests/test.xht
new file mode 100644
index 00000000..6a092ad8
--- /dev/null
+++ b/tests/test.xht
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
+ <title>Test case</title>
+</head>
+
+<body>
+ <h1>Test case</h1>
+ <p>This document is not detected as application/xhtml+xml.</p>
+</body>
+</html>