Opened 12 years ago
Last modified 12 years ago
#10306 confirmed Bug
Anchor allows spaces in id attribute. — at Initial Version
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.6.5 |
Keywords: | Orcale | Cc: |
Description
According to http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#the-id-attribute - there can't be any spaces in id attribute.
If you put in editor code like:
<p><a href="#first anchor">#first anchor</a></p> <p>Lots of P</p> <p><a id="first anchor" name="first anchor"></a></p>
it will work in e.g. Chrome or IE9. If you press preview button then click on link at the top you will see it works and browsers properly do the "jump" to the bottom.
If you put this code in HTML5 Validator you will get 2 messages:
"Bad value first anchor for attribute id on element a: An ID must not contain whitespace."
"Bad value #first anchor for attribute href on element a: Whitespace in fragment component. Use %20 in place of spaces."
I think that in this case first message is the one we should focus on and not allow entering spaces into anchor.
Problem can be reproduced from CKEditor 3.6.5 rev. [7618] when id for anchor was introduced.