java.lang.Object | |
↳ | com.atlassian.confluence.content.render.xhtml.HtmlElementIdCreator |
A non-thread safe class used to create HTML ids within a render 'context'.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The draft HTML5 spec states that the id attribute value
must be unique amongst all the IDs in the element's home subtree and must contain at least one character. | |||||||||||
The current implementation is very simplistic and will simply create id's of the pattern "id-<n>".
| |||||||||||
The draft HTML5 spec states that the id attribute value
must be unique amongst all the IDs in the element's home subtree and must contain at least one character. |
[Expand]
Inherited Methods | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object | |||||||||||||||
From interface
com.atlassian.confluence.content.render.xhtml.ElementIdCreator
|
The draft HTML5 spec states that the id attribute 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.(As specified at http://dev.w3.org/html5/spec/elements.html#the-id-attribute).
This method will take an arbitrary String and ensure that all white space and punctuation are removed, except for hyphens. This method does not necessarily create unique ids. You should use #convertToUniqueId(String) if you have this requirement.
str | the string to be converted to an id |
---|
The current implementation is very simplistic and will simply create id's of the pattern "id-<n>".
The draft HTML5 spec states that the id attribute 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.(As specified at http://dev.w3.org/html5/spec/elements.html#the-id-attribute).
This method will take an arbitrary String and ensure that the above encoding is followed as well as ensuring that the id returned is unique (within the scope
of this HtmlElementIdCreator
instance).
HtmlElementIdCreator
instance.