about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-03-15 22:55:22 +0100
committerGitHub <noreply@github.com>2017-03-15 22:55:22 +0100
commite245115f47082ffba27205f508301d14e792c369 (patch)
tree21a77b788dace45b734da6e64f1b0705016192f0 /app/lib/formatter.rb
parent620f70e42c16c324459ca2da52c68f1def8683de (diff)
parentc1124228e857b0e85f5bf927d2c41c7fadfdf955 (diff)
Merge branch 'master' into mastodon-site-api
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index e353c3504..b58952ae0 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -29,6 +29,11 @@ class Formatter
     sanitize(html, tags: %w(a br p span), attributes: %w(href rel class))
   end
 
+  def plaintext(status)
+    return status.text if status.local?
+    strip_tags(status.text)
+  end
+
   def simplified_format(account)
     return reformat(account.note) unless account.local?