[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6.1: HTML5 makes the attribute "name" in hypertext anchors obsolete.

From: Per Bothner
Subject: Re: 6.1: HTML5 makes the attribute "name" in hypertext anchors obsolete.
Date: Tue, 22 Aug 2017 22:44:50 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

This is a belated followup to:

On 5 August 2016 at 16:59, Patrice Dumas <address@hidden> wrote:
On Fri, Aug 05, 2016 at 10:33:41AM -0400, Robert Weiner wrote:
Just a small thing.

As of Texinfo 6.1, HTML output is generating anchors like so:

<a name="Smart-Keys"></a>

The non-obsolete way of doing that now, compatible with HTML5 and prior
versions is:

<a id="Smart-Keys"></a>

Using id instad of name leads to validation errors with the 4.01

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

That's because in this dtd, id type is ID which is too restrictive,
while in html5 it is much less restricted.

To re-phrase this for people less expert wrt html standards, DTDs, etc:

In HTML 4, the attribute 'id' may be on (almost) any element,
but to be "valid" (in the technical sense of matching the DTD "grammar")
it must have the form of an ID, defined as:

   ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed 
by any number of letters,
   digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods 

No browser has ever required that documents be "valid" in this sense, and
HTML 5 extends the set of allowed characters in an 'id' attribute.

However, makeinfo probably should stick to the HTML 4 restriction, regardless,
(at least for English-language documents), because this matches the Posix
"Portable Filename Character Set" (plus colons, which should be avoided).
It is simpler to use a simple consistent "mangling" from node names etc to
file names, URL links, and id anchors.

The specific example:
  <a id="Smart-Keys"></a>
is perfectly fine for HTML 4  I just tested it with the W3C Markup Validation 
        --Per Bothner
address@hidden   http://per.bothner.com/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]