Comment
Member Summary
Public Members | ||
public |
The time in which the comment was created. |
|
public |
An HTML enabled representation of the comment. |
|
public |
The comment's unique identifier. |
|
public |
The custom metadata. |
|
public |
The page number the comment was placed on (for static proofs). |
|
public |
For replies, the comment id the reply was created against. |
|
public |
For comments (not replies) the pin location information. |
|
public |
The raw comment text (unencrypted). |
|
public |
What kind of comment it is. |
|
public |
A text-only representation of the comment (unencrypted). |
|
public |
The last time the comment was updated by the creator. |
|
public |
The user who created the comment. |
Public Members
public html: string source
An HTML enabled representation of the comment.
Any user entered HTML entities are escaped, however user mentions are wrapped in a <span>
element containing
various metadata. Use this if you wish to easily render the comment on-screen to a user. It gives you a simple way
of styling the mentions, and ensures that any malicious text is stripped out.
public metadata: object source
The custom metadata.
For HTML proofs - this object contains various information about the comment in relation to the HTML document. We don't recommend you make use of this object until we provide a simple way to access the data without having to manually access the values by key.
public pageNumber: number source
The page number the comment was placed on (for static proofs).
In the case of replies, this number is the same as it's parent comment. In most cases, you can ignore this field for replies, as you ideally want to group comments an replies.
public parentCommentId: string | null source
For replies, the comment id the reply was created against.
For comments, this field is null.
public pin: Pin source
For comments (not replies) the pin location information.
This field is null for replies, as replies do not have a location on the proof.
public raw: string source
The raw comment text (unencrypted).
The raw comment text. It is not recommended you make use of this value, as it contains special tokens to represent (for example) user mentions. Instead, make use of the Comment.text or Comment.html properties if you're rendering on-screen.
Warning: The value of this property may contain unescaped HTML entities. So if you need to make use of it, ensure you escape HTML before displaying the text to the user. Because the comment text is encrypted & decrypted on the client side, PageProof is not able to do any sanitisation.
public state: string | null source
What kind of comment it is.
Possible values include: null
(for regular comments & all replies), todo
and done
.