emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HTML export meta tag
@ 2023-05-29 18:02 Scott Randby
  2023-05-29 18:07 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Randby @ 2023-05-29 18:02 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

When I export to HTML using Org 9.6.6, there is a /> closing the meta tag:

<meta name="author" content="Scott Randby" />

This did not happen when I used Org 9.4.6:

<meta name="author" content="Scott Randby">

I wouldn't care about this change, but when I validate the page code (https://validator.w3.org/) I get the following: "Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values."

The documentation I've seen states that the code without the trailing slash is the proper code. I request that the org-html--build-meta-entry function in ox-html.el be changed to eliminate the trailing slash.

Scott Randby


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

* Re: HTML export meta tag
  2023-05-29 18:02 HTML export meta tag Scott Randby
@ 2023-05-29 18:07 ` Ihor Radchenko
  2023-05-29 18:19   ` Scott Randby
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2023-05-29 18:07 UTC (permalink / raw)
  To: Scott Randby, Timothy; +Cc: emacs-orgmode

Scott Randby <srandby@gmail.com> writes:

> <meta name="author" content="Scott Randby" />
>
> This did not happen when I used Org 9.4.6:
>
> <meta name="author" content="Scott Randby">
>
> I wouldn't care about this change, but when I validate the page code (https://validator.w3.org/) I get the following: "Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values."

Timothy, may you take a look?

-- 
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] 7+ messages in thread

* Re: HTML export meta tag
  2023-05-29 18:07 ` Ihor Radchenko
@ 2023-05-29 18:19   ` Scott Randby
  2023-05-29 20:37     ` Timothy
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Randby @ 2023-05-29 18:19 UTC (permalink / raw)
  To: Ihor Radchenko, Timothy; +Cc: emacs-orgmode

On 5/29/23 14:07, Ihor Radchenko wrote:
> Scott Randby <srandby@gmail.com> writes:
> 
>> <meta name="author" content="Scott Randby" />
>>
>> This did not happen when I used Org 9.4.6:
>>
>> <meta name="author" content="Scott Randby">
>>
>> I wouldn't care about this change, but when I validate the page code (https://validator.w3.org/) I get the following: "Info: Trailing slash on void elements has no effect and interacts badly with unquoted attribute values."
> 
> Timothy, may you take a look?

Just to give some support to my request, the HTML standard (https://html.spec.whatwg.org/multipage/syntax.html#start-tags) says this: "Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/), which on foreign elements marks the start tag as self-closing. On void elements, it does not mark the start tag as self-closing but instead is unnecessary and has no effect of any kind. For such void elements, it should be used only with caution — especially since, if directly preceded by an unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser."

Scott



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

* Re: HTML export meta tag
  2023-05-29 18:19   ` Scott Randby
@ 2023-05-29 20:37     ` Timothy
  2023-05-29 22:25       ` Scott Randby
  2023-05-30 15:37       ` Max Nikulin
  0 siblings, 2 replies; 7+ messages in thread
From: Timothy @ 2023-05-29 20:37 UTC (permalink / raw)
  To: Scott Randby; +Cc: Ihor Radchenko, emacs-orgmode

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

Hi Scott,

> Just to give some support to my request, the HTML standard
> (<https://html.spec.whatwg.org/multipage/syntax.html#start-tags>) says this:
> “Then, if the element is one of the void elements, or if the element is a
> foreign element, then there may be a single U+002F SOLIDUS character (/), which
> on foreign elements marks the start tag as self-closing. On void elements, it
> does not mark the start tag as self-closing but instead is unnecessary and has
> no effect of any kind. For such void elements, it should be used only with
> caution — especially since, if directly preceded by an unquoted attribute value,
> it becomes part of the attribute value rather than being discarded by the
> parser.”

The things is the ox-html exporter currently tries to (mostly) support XHTML,
which as I understand requires the self-closing slash.

I think what’s really needed is an HTML export implementation that can more
easily support different “modes” of export, but somebody needs to work on that
🙃.

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), 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/tec>.

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

* Re: HTML export meta tag
  2023-05-29 20:37     ` Timothy
@ 2023-05-29 22:25       ` Scott Randby
  2023-05-30  6:12         ` Ihor Radchenko
  2023-05-30 15:37       ` Max Nikulin
  1 sibling, 1 reply; 7+ messages in thread
From: Scott Randby @ 2023-05-29 22:25 UTC (permalink / raw)
  To: Timothy; +Cc: Ihor Radchenko, emacs-orgmode

On 5/29/23 16:37, Timothy wrote:
> Hi Scott,
> 
>> Just to give some support to my request, the HTML standard
>> (<https://html.spec.whatwg.org/multipage/syntax.html#start-tags>) says this:
>> “Then, if the element is one of the void elements, or if the element is a
>> foreign element, then there may be a single U+002F SOLIDUS character (/), which
>> on foreign elements marks the start tag as self-closing. On void elements, it
>> does not mark the start tag as self-closing but instead is unnecessary and has
>> no effect of any kind. For such void elements, it should be used only with
>> caution — especially since, if directly preceded by an unquoted attribute value,
>> it becomes part of the attribute value rather than being discarded by the
>> parser.”
> 
> The things is the ox-html exporter currently tries to (mostly) support XHTML,
> which as I understand requires the self-closing slash.
> 
> I think what’s really needed is an HTML export implementation that can more
> easily support different “modes” of export, but somebody needs to work on that
> 🙃.

Okay, but when I try to validate my page as XHTML, I get numerous errors that would be inconvenient to fix especially since I'm only interested in obtaining valid HTML. What I think I'll do is to edit the org-html--build-meta-entry function in my ox-html.el file to eliminate the trailing slash. I'll just have to remember to do that every time I upgrade Org.

Scott


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

* Re: HTML export meta tag
  2023-05-29 22:25       ` Scott Randby
@ 2023-05-30  6:12         ` Ihor Radchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2023-05-30  6:12 UTC (permalink / raw)
  To: Scott Randby; +Cc: Timothy, emacs-orgmode

Scott Randby <srandby@gmail.com> writes:

> Okay, but when I try to validate my page as XHTML, I get numerous errors that would be inconvenient to fix especially since I'm only interested in obtaining valid HTML. What I think I'll do is to edit the org-html--build-meta-entry function in my ox-html.el file to eliminate the trailing slash. I'll just have to remember to do that every time I upgrade Org.

No need to remember.
You can (1) use git version of Org with your patch on top; (2) the same
via straight.el, which is rebase things for you automatically; (3)
https://github.com/radian-software/el-patch

-- 
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] 7+ messages in thread

* Re: HTML export meta tag
  2023-05-29 20:37     ` Timothy
  2023-05-29 22:25       ` Scott Randby
@ 2023-05-30 15:37       ` Max Nikulin
  1 sibling, 0 replies; 7+ messages in thread
From: Max Nikulin @ 2023-05-30 15:37 UTC (permalink / raw)
  To: emacs-orgmode

On 30/05/2023 03:37, Timothy wrote:
> The things is the ox-html exporter currently tries to (mostly) support XHTML,
> which as I understand requires the self-closing slash.

ox-html has

     (:html-doctype "HTML_DOCTYPE" nil org-html-doctype)

option that may be set to e.g. xhtml-11 or html5. Ideally both syntax 
variants should be supported, with "/" before ">" and without it.



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

end of thread, other threads:[~2023-05-30 15:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-29 18:02 HTML export meta tag Scott Randby
2023-05-29 18:07 ` Ihor Radchenko
2023-05-29 18:19   ` Scott Randby
2023-05-29 20:37     ` Timothy
2023-05-29 22:25       ` Scott Randby
2023-05-30  6:12         ` Ihor Radchenko
2023-05-30 15:37       ` Max Nikulin

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).