forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferdinand Soethe <>
Subject Re: Change of handling of ID-attributes
Date Sun, 31 Jul 2005 10:29:38 GMT

Diwaker Gupta wrote:

>> Looking closely at document2html (in common) I have my doubts about
>> the usefulness of translating every id-attribute into an html-anchor
>> (<a name="..."/>) element. Especially when I start using ids for CSS,
>> it means that this drastically increases the volume of the final page
>> by creating lots of anchors that nobody needs.

> This also breaks HTML compliance in many cases because in many places the
> value of the id attribute is constructed using the contents of <title> tags,
> for instance. IIRC, a URLencoder() is run on the truncated string to generate
> the ID attribute, and this often contains characters (such as +) that are not
> allowed by XHTML in id attributes.

Good point though a different problem really. Would you consider
fixing the way the IDs are generated when there are no ID-attributes
present. Is there another algorithm we can use that will not give us
forbidden chars in to ID?

>> Wouldn't it make more sense to limit this anchor-processing of
>> id-attributes to a few structural elements like headings and just copy
>> the id without processing for all other elements?

> +1. What do you mean by copying the id for all other elements?

I mean that an ID-element present in a source element would be copied
into the resulting html-element without any further processing. So
that I transform <figure id="bla"> would result in something like <img
 id="bla"> and can be used in CSS-styling of the output.

Ferdinand Soethe

View raw message