Does anyone else have any opinion about that?
(Changing <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
in the manual to <!DOCTYPE html>.)
I would assume that modern browsers should be able to read HTML 4,
but maybe that is not the case. Can't this change cause issues in older
browsers?
> Here's a patch suggestion to adjust the manual/2html generator script so
> that it uses proper HTML5 DOCTYPE tags when generating the manual HTML. In
> HTML5, the doctype should just be <!DOCTYPE html> and nothing else, all the
> other cruft is deprecated.
>
> Using a "DOCTYPE legacy string" (as the current HTML standard calls it
> <
https://html.spec.whatwg.org/multipage/syntax.html#the-doctype>) with the
> additional attributes can cause browsers to activate quirks mode
> <
https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode> (as
> Chrome reports it has, when viewing the Lua docs) and that can affect the
> layout of pages.
>
> I'm not *sure*, because I can't reproduce it with offline copies, but I
> think quirks mode processing *might* be the cause of a page-reflow issue
> I'm seeing with the online manual, in Chrome on Linux:
>
> 1. If I go to
https://www.lua.org/manual/5.4/contents.html#index
> 2. And select one of the library functions, os.getenv
> <
https://www.lua.org/manual/5.4/manual.html#pdf-os.getenv> for example
> (but it could be any one)
> 3. The browser will navigate to
>
https://www.lua.org/manual/5.4/manual.html#pdf-os.getenv
> 4. The page will initially load with the *os.getenv (varname)* heading
> at the top of the window
> 5. Then a fraction of a second later, as it finishes loading, it will
> reflow the document and the targeted heading will jump offscreen
> 6. I have to scroll upwards about half a page-length to get back to it
>
> Can't reproduce it in incognito mode, can't reproduce it with the offline
> copy installed in /usr/share/doc/lua/, can't reproduce it in Firefox. But
> it's been happening to me for a while now, in Chrome, and I'm hoping this
> might help. Even if it doesn't, using the correct, modern HTML5 doctype tag
> is a good idea anyway.
>
> --
> You received this message because you are subscribed to the Google Groups "lua-l" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
lua-l+un...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/lua-l/aed0f721-e35f-4f57-aeb3-a3d95e1288b2n%40googlegroups.com.
> >From 68456f5b928826eccf652c07d64669bb8c5aafeb Mon Sep 17 00:00:00 2001
> From: "FeRD (Frank Dana)" <
fer...@gmail.com>
> Date: Sat, 21 Jun 2025 02:00:49 -0400
> Subject: [PATCH] 2html: Use modern HTML5 doctype
>
> Using the full HTML3/HTML4-format `<!DOCTYPE html PUBLIC "...">`
> file header causes the document to be interpreted in quirks mode[1].
> The correct[2] HTML5 doctype tag is merely `<!DOCTYPE html>`, full
> stop.
>
> [1]:
https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode
> [2]:
https://html.spec.whatwg.org/multipage/syntax.html#the-doctype
> ---
> manual/2html | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/manual/2html b/manual/2html
> index ac5ea043..860f8bf1 100755
> --- a/manual/2html
> +++ b/manual/2html
> @@ -8,7 +8,7 @@
>
> ---------------------------------------------------------------
> header = [[
> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
> +<!DOCTYPE html>
> <html>
>
> <head>
> --
> 2.49.0
>
-- Roberto