[WIP] Enable custom emoji on account pages and in the sidebar (#6124)
Federate custom emojis with accounts
This commit is contained in:
parent
f464f98fd3
commit
123a343d11
10 changed files with 158 additions and 5 deletions
|
@ -51,9 +51,14 @@ class Formatter
|
|||
strip_tags(text)
|
||||
end
|
||||
|
||||
def simplified_format(account)
|
||||
return reformat(account.note).html_safe unless account.local? # rubocop:disable Rails/OutputSafety
|
||||
linkify(account.note)
|
||||
def simplified_format(account, **options)
|
||||
html = if account.local?
|
||||
linkify(account.note)
|
||||
else
|
||||
reformat(account.note)
|
||||
end
|
||||
html = encode_custom_emojis(html, CustomEmoji.from_text(account.note, account.domain)) if options[:custom_emojify]
|
||||
html.html_safe # rubocop:disable Rails/OutputSafety
|
||||
end
|
||||
|
||||
def sanitize(html, config)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue