Add support for rendering highlights with comments
This commit implements rendering comments from the `["comment", <COMMENT_TEXT>]` tag in a highlight note. Comment contents get rendered like a kind 1 note's "content" field This commit also adds the `r` "reference" tag as a standard tag reference type Changelog-Added: Add support for rendering highlights with comments Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
committed by
William Casarin
parent
5834e1ee9b
commit
d71d448ac8
@@ -335,6 +335,10 @@ extension NdbNote {
|
||||
public var referenced_mute_items: References<MuteItem> {
|
||||
References<MuteItem>(tags: self.tags)
|
||||
}
|
||||
|
||||
public var referenced_comment_items: References<CommentItem> {
|
||||
References<CommentItem>(tags: self.tags)
|
||||
}
|
||||
|
||||
public var references: References<RefId> {
|
||||
References<RefId>(tags: self.tags)
|
||||
@@ -355,6 +359,9 @@ extension NdbNote {
|
||||
if known_kind == .dm {
|
||||
return decrypted(keypair: keypair) ?? "*failed to decrypt content*"
|
||||
}
|
||||
else if known_kind == .highlight {
|
||||
return self.referenced_comment_items.first?.content ?? ""
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user