diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-28 16:22:28 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-03-28 16:22:28 +0200 |
commit | f313bf3e97ddd83e7847ae00f5bdb488942c943c (patch) | |
tree | 5035b4504d35a85cb0b2fcbc65ce57ed5d0de71d /app/helpers | |
parent | a4e1830b5f15118bf2532401005376a0c6e896e6 (diff) | |
parent | 30658924a80434e6a2bceb61267b911ea8d37898 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/formatting_helper.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb index 66e9e1e91..e11156999 100644 --- a/app/helpers/formatting_helper.rb +++ b/app/helpers/formatting_helper.rb @@ -9,11 +9,19 @@ module FormattingHelper TextFormatter.new(text, options).to_s end - def extract_plain_text(text, local) - PlainTextFormatter.new(text, local).to_s + def extract_status_plain_text(status) + PlainTextFormatter.new(status.text, status.local?).to_s end def status_content_format(status) html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : [])) end + + def account_bio_format(account) + html_aware_format(account.note, account.local?) + end + + def account_field_value_format(field, with_rel_me: true) + html_aware_format(field.value, field.account.local?, with_rel_me: with_rel_me, with_domains: true, multiline: false) + end end |