public class HtmlComment extends Object implements HtmlPiece
For example,
`new HtmlComment("main article")`
will be rendered as
"<!-- main article -->"
.
Escaping:
consecutive dashes "--" are not allowed in html comments.
We escape it by inserting a backslash. For example,
`new HtmlComment("xx--yy\\zz")`
will be rendered as
"<!-- xx-\-yy\\zz -->"
.
Note that the backslash is also escaped to "\\".
Constructor and Description |
---|
HtmlComment(Object... content)
Create an HtmlComment.
|
Instance Methods | |
---|---|
List<CharSequence> |
getContent()
Get the content of this piece.
|
void |
render(int indent,
Consumer<CharSequence> out)
Render this piece as an html comment
"<!-- ... -->" . |
public HtmlComment(Object... content)
See getContent()
.
If an `obj` in `content` is not a CharSequence, it will be converted to one by `String.valueOf(obj)`. `obj` can be `null`.
public List<CharSequence> getContent()
The returned char sequences are from `content` passed to the constructor.
No escaping is done by this method. If you want an escaped result, use `render(0)`.
public void render(int indent, Consumer<CharSequence> out)
"<!-- ... -->"
.
Escaping is done by this method.