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

Use of text/xhtml content type is not standardized #10819

Open
rodarima opened this issue Apr 23, 2024 · 1 comment
Open

Use of text/xhtml content type is not standardized #10819

rodarima opened this issue Apr 23, 2024 · 1 comment
Labels
bug HTML HTML / XHTML output needinfo reported bug is incomplete, please add additional info

Comments

@rodarima
Copy link

The XHTML 1.0 documents generated by Doxygen include a <meta> tag that overrides the content type to "text/xhtml":

% curl -s https://www.doxygen.nl/manual/index.html | grep Content-Type
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
% curl -s https://dillo-browser.github.io/doxygen/index.html | grep Content-Type
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>

Generated from here:

https://github.com/doxygen/doxygen/blame/78422d3905e57acebf0374feefafa6578dbe86aa/templates/html/header.html#L4

AFAIK, the content type "text/xhtml" is not standard, even if the W3 validator doesn't complain. It was included in one of the first drafts of the XHTML 1.0 specification in February of 1999, but a concern was raised to add a new media type, and later removed in May, finally ending in "text/html" or "application/xhtml+xml", see:

https://www.w3.org/TR/xhtml-media-types/
https://www.w3.org/TR/xhtml1/#C_9

This problem was observed when fixing a similar problem in the Dillo browser, which has a workaround to handle the "text/xhtml" content for Doxygen.

Here is the patch:

From 23113eed9a15308d75eb28a737324296ce10081c Mon Sep 17 00:00:00 2001
From: Rodrigo Arias Mallo <rodarima@gmail.com>
Date: Wed, 24 Apr 2024 00:08:10 +0200
Subject: [PATCH] Use text/html as content type

---
 templates/html/header.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/html/header.html b/templates/html/header.html
index 56bf81e42..4eb68115a 100644
--- a/templates/html/header.html
+++ b/templates/html/header.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
 <head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
 <meta http-equiv="X-UA-Compatible" content="IE=11"/>
 <meta name="generator" content="Doxygen $doxygenversion"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-- 
2.44.0
@rodarima rodarima changed the title Use of text/xhtml content type are not standardized Use of text/xhtml content type is not standardized Apr 23, 2024
@albert-github albert-github added bug needinfo reported bug is incomplete, please add additional info HTML HTML / XHTML output labels Apr 24, 2024
@albert-github
Copy link
Collaborator

The meta tag is a difficult problem, but in https://www.w3.org/TR/xhtml-media-types/#media-types there us no mention of text/xhtml at all so it looks like it would be better to use application/xhtml+xml.
I don't know whether this will have some side effects though.

@doxygen what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug HTML HTML / XHTML output needinfo reported bug is incomplete, please add additional info
Projects
None yet
Development

No branches or pull requests

2 participants