Issue 154 in gwtwiki: toc generate not valid anchor

3 views
Skip to first unread message

gwt...@googlecode.com

unread,
Jan 10, 2014, 4:35:29 AM1/10/14
to bl...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 154 by Rory...@gmail.com: toc generate not valid anchor
http://code.google.com/p/gwtwiki/issues/detail?id=154

if the section is not start with a letter [a-zA-Z] will generate a not
valid html dom id

{

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

}

example the Chinese section will generate a anchor

[第一章], [.E7.AC.AC.E4.B8.80.E7.AB.A0]

when use jquery to select this anchor cause a Synatax error:

{
Error: Syntax error, unrecognized expression: #.E7.AC.AC.E4.B8.80.E7.AB.A0
}


maybe we can make a default prefix when the anchor not start with the
letter, "head" or "h" for example?

Thanks

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

gwt...@googlecode.com

unread,
Jan 11, 2014, 5:52:37 PM1/11/14
to bl...@googlegroups.com
Updates:
Owner: axe...@gmail.com
Labels: -Type-Defect Type-Enhancement

Comment #1 on issue 154 by axe...@gmail.com: toc generate not valid anchor
http://code.google.com/p/gwtwiki/issues/detail?id=154

If you look into chinese wikipedia, they don't add a special character?
Example:
http://zh.wikipedia.org/wiki/%E4%B8%8A%E6%B5%B7%E5%B8%82

Nethertheless I've attached a patch to this issue, which you could try for
your purposes.

Attachments:
patch_issue154.txt 745 bytes

gwt...@googlecode.com

unread,
Jan 12, 2014, 9:13:07 PM1/12/14
to bl...@googlegroups.com

Comment #2 on issue 154 by Rory...@gmail.com: toc generate not valid anchor
http://code.google.com/p/gwtwiki/issues/detail?id=154

Ok, Thanks axelclk, I found this too.But I don't understand why the
wikipedia use a invalid ID as anchor.

BTW: this patch will not in trunk, right?

gwt...@googlecode.com

unread,
Jan 13, 2014, 5:01:50 AM1/13/14
to bl...@googlegroups.com

Comment #3 on issue 154 by Rory...@gmail.com: toc generate not valid anchor
http://code.google.com/p/gwtwiki/issues/detail?id=154

Hi, axelclk, I learn from w3c.org that in HTML5 the ID attribute start
with "." is valid. so no problem in HTML5 page.

{{{

3.2.5.1 The id attribute

The id attribute specifies its element's unique identifier (ID). [DOM]

The value must be unique amongst all the IDs in the element's home subtree
and must contain at least one character. The value must not contain any
space characters.
}}}

BTW:Thanks your patch.
Reply all
Reply to author
Forward
0 new messages