emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]
@ 2024-03-25 11:18 Ihor Radchenko
  2024-03-27 15:35 ` Max Nikulin
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2024-03-25 11:18 UTC (permalink / raw)
  To: emacs-orgmode, orgmode; +Cc: c.buhtz

[-- Attachment #1: Type: text/plain, Size: 985 bytes --]


Setting (setq org-html-doctype "html4-strict") and exporting a trivial
Org document (like the attached) to HTML fails to pass validation at
https://validator.w3.org/

The error is

 Line 6, Column 72: character data is not allowed here
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

 ....using XHTML-style self-closing tags (such as <meta ... />) in HTML
 4.01 or earlier. To fix, remove the extra slash ('/') character. For
 more information about the reasons for this, see Empty elements in
 SGML, HTML, XML, and XHTML.

caused by /> self-closing tag.

However, dropping /> will lead to validation failing for the default
value of `org-html-doctype' - "xhtml-strict".

I am wondering whether it is at all possible to use the same syntax and
yet pass validation for all the allowed values of `org-html-doctype':
"html4-strict", "html4-transitional", "html4-frameset", "xhtml-strict",
"xhtml-transitional", "xhtml-frameset", "xhtml-11", "html5", "xhtml5".


[-- Attachment #2: 20240322205907-testmath.org --]
[-- Type: application/vnd.lotus-organizer, Size: 119 bytes --]

:PROPERTIES:
:ID:       d6de1b70-d3d9-4f6a-be94-4d23d9ed2bfc
:END:
#+title: testmath
#+date: [2024-03-22 20:59]
foobar

[-- Attachment #3: Type: text/plain, Size: 457 bytes --]


Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
 of 2024-03-24
Package: Org mode version 9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)
-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]
  2024-03-25 11:18 [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
@ 2024-03-27 15:35 ` Max Nikulin
  2024-03-28 11:27   ` ox-html content-type metadata (was: [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]) Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Max Nikulin @ 2024-03-27 15:35 UTC (permalink / raw)
  To: emacs-orgmode

On 25/03/2024 18:18, Ihor Radchenko wrote:
> I am wondering whether it is at all possible to use the same syntax and
> yet pass validation for all the allowed values of `org-html-doctype':
> "html4-strict", "html4-transitional", "html4-frameset", "xhtml-strict",
> "xhtml-transitional", "xhtml-frameset", "xhtml-11", "html5", "xhtml5".

Is it correct to use text/html for XHTML? I would expect 
application/xhtml+xml, but it is better to check standard.

For html5 my expectation is

     <meta charset="utf-8">

instead of http-equiv
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#charset



^ permalink raw reply	[flat|nested] 3+ messages in thread

* ox-html content-type metadata (was: [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)])
  2024-03-27 15:35 ` Max Nikulin
@ 2024-03-28 11:27   ` Ihor Radchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2024-03-28 11:27 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode


This is tangent to the original problem I described.

Max Nikulin <manikulin@gmail.com> writes:

> On 25/03/2024 18:18, Ihor Radchenko wrote:
>> I am wondering whether it is at all possible to use the same syntax and
>> yet pass validation for all the allowed values of `org-html-doctype':
>> "html4-strict", "html4-transitional", "html4-frameset", "xhtml-strict",
>> "xhtml-transitional", "xhtml-frameset", "xhtml-11", "html5", "xhtml5".
>
> Is it correct to use text/html for XHTML? I would expect 
> application/xhtml+xml, but it is better to check standard.

It is certainly not an error.

Also,
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#texthtml
says

All HTML content should be served with this type. Alternative MIME types
for XHTML (like application/xhtml+xml) are mostly useless nowadays.

> For html5 my expectation is
>
>      <meta charset="utf-8">
>
> instead of http-equiv
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#charset

What made you think that your expectation is not fulfilled by ox-html?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-28 11:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 11:18 [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)] Ihor Radchenko
2024-03-27 15:35 ` Max Nikulin
2024-03-28 11:27   ` ox-html content-type metadata (was: [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]) Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).