Go to the FreeLists Home Page Home Signup Help Login
 



[dokuwiki] || [Date Prev] [02-2006 Date Index] [Date Next] || [Thread Prev] [02-2006 Thread Index] [Thread Next]

[dokuwiki] Re: invalid anchors

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 09 Feb 2006 09:43:47 +0100
Anika Henke writes:

Why do you only want to change the ids and not the names? By not changing the names, existing links are already broken!

When I talk about id I always mean id and name attributes. I'm lazy ;-)

Sorry, but underscores are not allowed for names/ids to begin with as well:
<cite>
ID and NAME 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 (".").
</cite>

Damned. We have another problem here. The above spec does only allow ASCII, nothing said about Japanese or Cyrillic. Who the hell came up with this stupidity? I want my Unicode!


Hmm... Okay I just checked something...

I created a headline ==== Foo <jap> Bar ==== with <jap> being a japanese character.

DokuWiki creates a name attribute name="foo_<jap>_bar". Running tidy on this gives this Warning (not Error!):

 ... cannot copy name attribute to id
 Cause:

In XHTML, the "name" attribute has been deprecated and replaced by the "id" attribute. If you want to keep both tags for compatibility reason, name and id, the values should be the same.
This error is generated when only the name exists and that tidy try to copy the value of the name in the id attribute. But an "id" must begin with a letter ([A-Za-z]).


Notice somthing? It seems to be fine for the name attribute.

To be sure I send the HTML to the W3C validator. Here is what it says:

 This Page Is Valid XHTML 1.0 Transitional!

I then repeated both steps with this headline: ==== 2Foo <jap> Bar ====

Which gave me the exact same results!

So obviously we only have a real problem with the id attribute and Unicode/Digits@start. We added the id only for making a transition to XHTML strict simpler, but never intended to ship DokuWiki with strict by default anyway. So here is my proposal:

We do NOT add the id attribute for the headlines, but add a comment in the XHTML renderer source where it should be done if needed for strict. Users who need strict for whatever reason can change it themself.

For making sure, names are unique we go with my proposed idea of adding numbers when needed.

This may not be the coolest thing to do standardwise. But this offers the best usability without violating any specs. Hooray for transitional :-)

Andi

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist




[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.